Decorators¶
-
misbot.decorators.
signed_up
(func)¶ Checks if user is signed up or not. If user isn’t signed up, sends a message asking them to register.
Parameters: func (func) – A telegram bot function Returns: None if user isn’t registered or the function which decorator is applied on. Return type: None or func
-
misbot.decorators.
admin
(func)¶ Checks if the user sending the command/message is an admin or not. If user isn’t an admin, their username (or chat ID, if unregistered) is logged and a message is sent saying that the incident has been reported.
Parameters: func (func) – A telegram bot function Returns: None if user isn’t registered or the function which decorator is applied on. Return type: None or func
Checks if the user sending the command/message is a premium member or not.
Parameters: tier (int) – The tier level of the user permitted to use the feature Returns: None if user doesn’t satisfy tier level or the function which decorator is applied on. Return type: None or func