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

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

Bot api 6.4 Topics support. #622

Open Hamper opened 1 year ago

Hamper commented 1 year ago

Telegram bot api have new topics in chats, without this logic bots can't properly respond to chats with topics.

rikosage commented 1 year ago

+1

oneart-dev commented 1 year ago

+1

marcozaccari commented 1 year ago

+1

endvvell commented 1 year ago

+1

endvvell commented 1 year ago

I'll just leave my quick and ugly temporary solution here on how to send messages to the different topics with the current state of this package, just in case someone might find it helpful: https://go.dev/play/p/7w6uMC6XB3P

It appears adding this functionality to the package would be as easy as adding ThreadID int to the BaseChat and BaseEdit structs in configs.go file and adding something like params.AddNonZero("message_thread_id", chat.ThreadID) to the BaseChat implementation of params() method & params.AddNonZero("message_thread_id", edit.ThreadID) to the BaseEdit implementation of params() method

But surely it's more than that and we'll just have to wait for someone with some spare time to go over this.

Gleb-ho commented 1 year ago

https://github.com/go-telegram-bot-api/telegram-bot-api/pull/663