aiogram / bot

This bot is used as example of usage aiogram framework and as admin-helper in our community chats.
https://t.me/aiogram_bot
MIT License
267 stars 56 forks source link

The command `!set_superuser` won't work #6

Open russian-developer opened 4 years ago

russian-developer commented 4 years ago

https://github.com/aiogram/bot/blob/5d892a24724b3cd9b50928f1f5753e8b38d537c4/app/handlers/superuser.py#L9

In the first lines of the function above, you check the user_id is existed by calling get_args method of the message. The check always returns false. The method message.get_args() returns an argument only if it command that starts with /.

Trace: message.get_args() -> message.get_full_command() -> message.is_command() -> return self.text and self.text.startswith("/")