mirror of
https://github.com/Nick80835/microbot
synced 2025-08-31 14:38:04 +00:00
add support for inline article results
This commit is contained in:
@@ -35,6 +35,7 @@ class Loader():
|
||||
def reload_all_modules(self):
|
||||
self.command_handler.incoming_commands = {}
|
||||
self.command_handler.inline_photo_commands = {}
|
||||
self.command_handler.inline_article_commands = {}
|
||||
self.help_dict = {}
|
||||
|
||||
errors = ""
|
||||
@@ -83,6 +84,19 @@ class Loader():
|
||||
|
||||
return decorator
|
||||
|
||||
def add_inline_article(self, pattern=None, **args):
|
||||
pattern = args.get("pattern", pattern)
|
||||
|
||||
def decorator(func):
|
||||
self.command_handler.inline_article_commands[pattern] = {
|
||||
"function": func,
|
||||
"default": args.get("default", 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