2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 06:26:04 +00:00

rework inline photos significantly

This commit is contained in:
Nick80835
2020-05-21 13:53:11 -04:00
parent d5b1ba00e8
commit 5b43817887
5 changed files with 84 additions and 38 deletions

View File

@@ -70,10 +70,13 @@ class Loader():
return decorator
def add_inline_photo(self, **args):
def add_inline_photo(self, pattern=None, **args):
pattern = args.get("pattern", pattern)
def decorator(func):
self.command_handler.inline_photo_commands[func.__name__] = {
"function": func
self.command_handler.inline_photo_commands[pattern] = {
"function": func,
"default": args.get("default", None)
}
return func