Replies: 2 comments
|
Yea this is an existing "problem", if we can call it one. Maybe we should introduce a new filter, something like bot_username, or make the user introduce it into the main class... didn't really give it a thought though, but changing the behaviour of the command is not possible. |
0 replies
It absoulutely not obvious that it should be. You solve it in 1 line of code, thus it's not a problem. PS. Calling get_me() on every function call (this will request TG every time) is auful. You should cache get_me answer also... |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
When using pyTelegramBotAPI, we can register a command using the decorator @bot.message_handler(commands=['help']). Let's say our bot has a username @example_bot, and this handler responds to the commands /help, /help@example_bot, which is correct. However, it also responds to the command /help@another_bot, which is incorrect.
Currently, the boilerplate code below is used to solve the problem, but it is obvious that it should be solved at the API level.
All reactions