go-telegram-bot-api / telegram-bot-api

Golang bindings for the Telegram Bot API
https://go-telegram-bot-api.dev
MIT License
5.75k stars 887 forks source link

telegram bot apiv5. need inditificate command in caption under photo. #723

Open aboguz opened 3 months ago

aboguz commented 3 months ago

if (update.Message.Photo.IsCommand() == "answer" && update.Message.Chat.ID == supportChatID){
handleAnswerCommand(bot, supportChatID, update.Message, update.Message.Photo[len(update.Message.Photo)-1].FileID, update.Message.Caption) } answer - command in tech channel which taking 3 arguments and writing like "/answer 1 <any text/text+photo> that's why i cant write only "/answer" or:

if update.Message.IsCommand() { switch update.Message.Command() { case "answer": //that case doing well without photo. but with - program can't see that case handleAnswerCommand(...) } }