From 2e37fc5c593b3fe6463fbc414b85ee4d6993d07f Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Mon, 15 Jul 2019 07:53:43 -0400 Subject: [PATCH] prepare for action_commands decorator --- sopel_modules/SpiceBot/Commands.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sopel_modules/SpiceBot/Commands.py b/sopel_modules/SpiceBot/Commands.py index 1563262..6f124e2 100644 --- a/sopel_modules/SpiceBot/Commands.py +++ b/sopel_modules/SpiceBot/Commands.py @@ -291,6 +291,10 @@ class BotCommands(): line = str(line).split("commands")[-1] line = "commands" + line detected_lines.append(line) + elif str(line).startswith(tuple(["action_commands", "module.action_commands", "sopel.module.action_commands"])): + line = str(line).split("action_commands")[-1] + line = "action_commands" + line + detected_lines.append(line) elif str(line).startswith(tuple(["nickname_commands", "module.nickname_commands", "sopel.module.nickname_commands"])): line = str(line).split("nickname_commands")[-1] line = "nickname_commands" + line @@ -326,6 +330,13 @@ class BotCommands(): except Exception as e: validcoms = e validcoms = [] + elif str(detected_line).startswith("action_commands"): + comtype = "action" + try: + validcoms = eval(str(detected_line).split("action_commands")[-1]) + except Exception as e: + validcoms = e + validcoms = [] elif str(detected_line).startswith("nickname_commands"): comtype = "nickname" try: