telegramlib.admin_command¶
- telegramlib.admin_command(func)[source]¶
Decorator to restrict command execution to the bot’s admin.
This decorator checks if the current user is the admin before executing the decorated function. It ensures that only the admin can perform certain sensitive actions, such as managing users or executing system commands.
- Parameters:
func (function) – The function to be wrapped and executed only by the admin.
- Returns:
wrapper – The wrapped function with admin check applied.
- Return type:
function