diff --git a/sopel_modules/SpiceBot_AI/AI.py b/sopel_modules/SpiceBot_AI/AI.py index 643133d..f03cb3b 100644 --- a/sopel_modules/SpiceBot_AI/AI.py +++ b/sopel_modules/SpiceBot_AI/AI.py @@ -12,15 +12,13 @@ from sopel_modules.SpiceBot_Events.System import bot_events_check @sopel.module.rule(r'(?i)(hi|hello|hey),? $nickname[ \t]*$') def bot_command_hello_a(bot, trigger): - bot_command_hello(bot, trigger) + hello = spicemanip.main(['Hi', 'Hey', 'Hello'], "random") + punctuation = spicemanip.main(['', '!', '?'], "random") + bot.osd(hello + ' ' + trigger.nick + punctuation) @sopel.module.nickname_commands('hello') def bot_command_hello_b(bot, trigger): - bot_command_hello(bot, trigger) - - -def bot_command_hello(bot, trigger): hello = spicemanip.main(['Hi', 'Hey', 'Hello'], "random") punctuation = spicemanip.main(['', '!', '?'], "random") bot.osd(hello + ' ' + trigger.nick + punctuation) diff --git a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py index 8c662a0..becf6e3 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py +++ b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py @@ -109,8 +109,18 @@ def setup(bot): elif str(line).startswith(tuple(["rule", "module.rule", "sopel.module.rule"])): comtype = "rule" line = str(line).split("rule(")[-1] - validcoms = [str("(" + line)] - validcomdict = {"comtype": comtype, "validcoms": validcoms} + line = str("(" + line) + validcoms = eval(str(line)) + if isinstance(validcoms, tuple): + validcoms = list(validcoms) + else: + validcoms = [validcoms] + for validcom in validcoms: + if validcom.startswith("$nickname"): + comtype = "nickname" + else: + comtype = "rule" + validcomdict = {"comtype": comtype, "validcoms": [validcom]} filelinelist.append(validcomdict) if len(filelinelist):