raito.plugins.commands.flags moduleยถ
- raito.plugins.commands.flags.description(description)[source]ยถ
Attach a description to the command handler for use in command registration (e.g.,
raito.register_commands)The description will be shown in the Telegram command list (via
set_my_commands) Supports internationalization via LazyProxy.- Parameters:
description (str | LazyProxy) โ A string or LazyProxy representing the description.
- Returns:
A FlagDecorator to be applied to the handler.
- Return type:
FlagDecorator
Mark a command handler as hidden from the command list.
Hidden handlers will not be included in Telegramโs slash commands when calling
raito.register_commands.
- raito.plugins.commands.flags.params(**kwargs)[source]ยถ
Define expected parameters and their types for command parsing.
This acts as a lightweight argument extractor and validator for commands. For example,
@rt.params(user_id=int)will extractuser_id=1234from a command like/ban 1234.Example
@router.message(filters.Command("ban")) @rt.params(user_id=int) def ban(message: Message, user_id: int): ...