aboutsummaryrefslogtreecommitdiff
path: root/modules/unknown_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/unknown_command.py')
-rw-r--r--modules/unknown_command.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/modules/unknown_command.py b/modules/unknown_command.py
deleted file mode 100644
index 386def9f..00000000
--- a/modules/unknown_command.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#--depends-on commands
-
-import difflib
-from src import ModuleManager, utils
-
-class Module(ModuleManager.BaseModule):
- def _all_command_hooks(self):
- return self.events.on("received.command").get_children()
-
- @utils.hook("unknown.command")
- def unknown_command(self, event):
- all_commands = self._all_command_hooks()
- match = difflib.get_close_matches(event["command"], all_commands,
- cutoff=0.7)
- if match:
- nickname = ""
- if event["is_channel"]:
- nickname = "%s: " % event["user"].nickname
-
- event["target"].send_message(
- "%sUnknown command. Did you mean %s%s?" % (
- nickname, event["command_prefix"], match[0]))