plus: remove shortcut option

This commit is contained in:
dece 2022-09-13 18:23:39 +02:00
parent 7f2fa0817e
commit 37a75f051d
2 changed files with 5 additions and 10 deletions

View file

@ -155,8 +155,7 @@
"commands": ["plus"],
"aliases": {
"plus": "more"
},
"shortcut": "+"
}
},
"randomchoice": {
"commands": ["choose"],

View file

@ -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):