telebot icon indicating copy to clipboard operation
telebot copied to clipboard

v3.4.1-beta breaks downstream

Open rusq opened this issue 1 year ago • 5 comments

Version: v3.4.1-beta

Context.Bot() used to return *telebot.Bot, but now returns telebot.API interface. I used to call "Handle" on what was returned by Context.Bot(), but the latest change breaks it.

Could the backward compatibility promise honoured in v3 please, and could breaking changes be introduced only with the major version number increase, as per Module Version Numbering?

rusq avatar Sep 10 '24 12:09 rusq

Fair point. What were the methods you used in Bot structure returned from context?

demget avatar Sep 23 '24 19:09 demget

Please ignore v3.4 versions, but take into account that the V3 major version won't be developing anymore. So to enable new Bot API versions you'll have to migrate anyway. Unless someone will make a PR for the new minor version of V3, then I'll keep it updated as long as possible.

demget avatar Sep 23 '24 19:09 demget

Btw you shouldn't use Handle for dynamic handling, that's basically not right.

demget avatar Sep 23 '24 20:09 demget

Hey @demget, thanks for the response. Apart from dynamic handling, I was using

voice.Send(c.Bot(), chat, opts)

where "c" is telebot.Context, and "voice" is telebot.Voice.

~When you say "migrate anyway", do you mean that telebot library won't be developed anymore?~ Noticed that there's a V4 milestone, amazing!

I was using v3.3.x, but needed the Star payments, so I decided to try my luck with v.3.4.1-beta

rusq avatar Sep 24 '24 07:09 rusq

  1. You can use a Middleware to set the bot instance to Context, then get it back from context later.
  2. I believe you can safely just cast the API back to *Bot, just check the code of func (b *Bot) NewContext(u Update) Context

jeffcaiz avatar Aug 11 '25 07:08 jeffcaiz