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

Unmarshal error for banChatMember method #705

Open alexpts opened 7 months ago

alexpts commented 7 months ago

Docs: https://core.telegram.org/bots/api#banchatmember

Returns True on success.

func (bot *BotAPI) Send(c Chattable) (Message, error) {
    resp, err := bot.Request(c)
    if err != nil {
        return Message{}, err
    }

    var message Message
    err = json.Unmarshal(resp.Result, &message) // resp.Result = true => Unmarshal error and throw error to up

    return message, err
}
huantt commented 6 months ago

The same error when I call answerCallbackQuery

huantt commented 6 months ago

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

bakatz commented 5 months ago

Great work @huantt - your fix looks good to me so I've gone ahead and switched my project to use your version. Saved me time having to fork and modify the source myself!

Annoying when you find an unmaintained project that is mostly great but has some glaring issues that are no longer being prioritized