You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
555 B

from edmond.plugin import Plugin
class UnknownCommandPlugin(Plugin):
def __init__(self, bot):
super().__init__(bot)
self.priority = -6
def on_pubmsg(self, event):
message = self.should_read_message(event.arguments[0])
if not message:
return False
words = message.split()
if len(words) == 0 or words[-1] != self.config["command_suffix"]:
return False
query = " ".join(words[:-1])
self.bot.say(event.target, f"UnknownCommand: {query}")
return True