diff --git a/utils/bot.py b/utils/bot.py new file mode 100644 index 0000000..1666750 --- /dev/null +++ b/utils/bot.py @@ -0,0 +1,17 @@ +from typing import List + +from telegram.ext import CallbackContext + + +def get_all_args(context: CallbackContext) -> List[str]: + args = context.args + match = context.match + if args is None: + if match is not None: + groups = match.groups() + return list(groups) + + else: + if len(args) >= 1: + return args + return []