2
0
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:
Nick80835
2020-05-25 14:04:56 -04:00
parent a8c8d4a25c
commit 91d1dba209
2 changed files with 77 additions and 27 deletions

View File

@@ -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: