kamihi.tg.handlers.auth_handler
⚓︎
Custom handler for Telegram bot that checks if a user is authorized to use a wrapped handler.
License
MIT
Classes:
| Name | Description |
|---|---|
AuthHandler |
Custom wrapper handler that checks if the user is authorized to use the wrapped handler before executing it. |
AuthHandler
⚓︎
AuthHandler(handler: BaseHandler, name: str)
Bases: BaseHandler
Custom wrapper handler that checks if the user is authorized to use the wrapped handler before executing it.
Attributes:
| Name | Type | Description |
|---|---|---|
handler |
BaseHandler
|
the handler to be wrapped. |
name |
str
|
The name of the action. |
Initialize the AuthHandler with the callback function.
Methods:
| Name | Description |
|---|---|
check_update |
Determine if an update should be handled by this handler instance. |
Source code in src/kamihi/tg/handlers/auth_handler.py
29 30 31 32 33 | |
check_update
⚓︎
check_update(update: Update) -> bool
Determine if an update should be handled by this handler instance.
Source code in src/kamihi/tg/handlers/auth_handler.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |