diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 5342522..d1fc8d3 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -49,12 +49,28 @@ def prerun(): # The command is not valid if comrun.is_catchall and not comrun.is_real_command: valid_command_results = sb.commands.search_similar_commands(comrun.command["trigger_command"]) - print(comrun.command_type) - if not len(valid_command_results): - comrun.osd("%s does not appear to be a valid command." % comrun.command["trigger_command"]) - else: - comrun.osd("%s does not appear to be a valid command. Possible Matches: %s" % (comrun.command["trigger_command"], valid_command_results)) - return + + # Don't be annoying when /me is conversation and not a command + if comrun.command_type == "action_command": + return + + # Handling for invalid nickname commands + if comrun.command_type == "nickname_command": + if not len(valid_command_results): + comrun.osd("I'm not sure what you are asking me to do! What do you mean by \"%s\" ?" % comrun.command["trigger_str"]) + else: + comrun.osd("%s does not appear to be a valid command. Possible Matches: %s" % (comrun.command["trigger_command"], valid_command_results)) + return + + # normal prefixed command handling + if comrun.command_type == "command": + + # warn that a command is not valid + if not len(valid_command_results): + comrun.osd("%s does not appear to be a valid command." % comrun.command["trigger_command"]) + else: + comrun.osd("%s does not appear to be a valid command. Possible Matches: %s" % (comrun.command["trigger_command"], valid_command_results)) + return # At this point, we update the re.match for trigger trigger = rebuild_trigger(comrun, function)