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

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

Send with InlineConfig argument return json unmarshal error #517

Open kbats183 opened 2 years ago

kbats183 commented 2 years ago

Method Send with InlineConfig as Chattable interface implementation invoke telegram api method answerInlineQuery, and unmarshal api responce to Message type.

https://github.com/go-telegram-bot-api/telegram-bot-api/blob/ef6e421559d82708b59888ba2022da7602284053/bot.go#L341-L351

But this api method return only boolean api reference.

And this leads to an error json: cannot unmarshal bool into Go value of type tgbotapi.Message.

Syfaro commented 2 years ago

Send should be used for methods that return a Message, Request should be used for everything else.

This issue has come up a few times before, I really should document this more clearly.

huantt commented 5 months ago

Looks like this project is inactive. I've forked & fixed this issue in this repo: https://github.com/huantt/telegram-bot-api