From 37a75f051df218c4658acb8ac3da2b54ccf5a547 Mon Sep 17 00:00:00 2001 From: dece Date: Tue, 13 Sep 2022 18:23:39 +0200 Subject: [PATCH] plus: remove shortcut option --- config.json.example | 3 +-- edmond/plugins/plus.py | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/config.json.example b/config.json.example index f72e903..607f4d2 100644 --- a/config.json.example +++ b/config.json.example @@ -155,8 +155,7 @@ "commands": ["plus"], "aliases": { "plus": "more" - }, - "shortcut": "+" + } }, "randomchoice": { "commands": ["choose"], diff --git a/edmond/plugins/plus.py b/edmond/plugins/plus.py index d74628e..886c30f 100644 --- a/edmond/plugins/plus.py +++ b/edmond/plugins/plus.py @@ -20,16 +20,12 @@ class PlusPlugin(Plugin): def __init__(self, bot): super().__init__(bot) self.handlers = {} - self.shortcut = self.config.get("shortcut") def on_pubmsg(self, event): - if ( - (self.shortcut and event.arguments[0].strip() == self.shortcut) - or self.should_handle_command(event.arguments[0], no_content=True) - ): - self.process_handler(event) - return True - return False + if not self.should_handle_command(event.arguments[0], no_content=True): + return False + self.process_handler(event) + return True def process_handler(self, event): if handler := self.handlers.pop(event.target, None):