telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

Unmarshal error for banChatMember method

Open alexpts opened this issue 1 year ago • 3 comments

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
}

alexpts avatar Feb 20 '24 21:02 alexpts

The same error when I call answerCallbackQuery

huantt avatar Mar 16 '24 06:03 huantt

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

huantt avatar Mar 17 '24 01:03 huantt

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

bakatz avatar Apr 19 '24 06:04 bakatz