mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 06:26:04 +00:00
add maybe broken support for callback queries
This commit is contained in:
@@ -35,6 +35,7 @@ class Loader():
|
||||
self.command_handler.incoming_commands = {}
|
||||
self.command_handler.inline_photo_commands = {}
|
||||
self.command_handler.inline_article_commands = {}
|
||||
self.command_handler.callback_queries = {}
|
||||
self.help_dict = {}
|
||||
|
||||
errors = ""
|
||||
@@ -99,6 +100,19 @@ class Loader():
|
||||
|
||||
return decorator
|
||||
|
||||
def add_callback_query(self, data_id=None, **args):
|
||||
data_id = args.get("data_id", data_id)
|
||||
|
||||
def decorator(func):
|
||||
self.command_handler.callback_queries[data_id] = {
|
||||
"function": func,
|
||||
"extras": args.get('extras', None)
|
||||
}
|
||||
|
||||
return func
|
||||
|
||||
return decorator
|
||||
|
||||
async def get_text(self, event, with_reply=True, return_msg=False, default=None):
|
||||
if event.args:
|
||||
if return_msg:
|
||||
|
Reference in New Issue
Block a user