You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AST transformers. AST transformers are applied after code transformers
exec hooks. Exec hooks are executed before the message is parsed and handled. Exec hooks must have the following signature: async hook(message: Message, is_edit: bool) -> Message | bool | None. An exec hook may edit the message using Telegram API methods and/or alter the message in place. If a hook returns Message object or alters it in place, it's used instead of the original Message object during the rest of handling (including calling other hook functions). If a hook returns True or None, execution completes normally. If a hook returns False, the rest of hooks are executed and then the handling stops without further message parsing or evaluating
Apply hooks with tgpy.api.exec_hooks.apply(message: Message, *, is_edit: bool) -> Message | False. This method returns False if any of the hooks returned False, Message object that should be used instead of the original one otherwise
new dict/list compatible transformers/hooks interface (store_obj is one of tgpy.api.code_transformers, tgpy.api.ast_transformers or tgpy.api.exec_hooks)
add a function with store_obj.add(name, function)
add/replace a function with store_obj[name] = function
get a function with store_obj[name or index]
iter functions with for name, function in store_obj
apply transformers/hooks with tgpy.api.code_transformers.apply(code: str) -> str, tgpy.api.ast_transformers.apply(tree: AST) -> AST or tgpy.api.exec_hooks.apply (documented above)
podman is now correctly detected so that tgpy doesn't try to update itself in the container