Skip to content

The command !set_superuser won't work #6

@russian-developer

Description

@russian-developer

@dp.message_handler(commands=["set_superuser"], commands_prefix="!", is_superuser=True)

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("/")

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersupstreamThis requires action with dependencies

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions