plus: remove shortcut option
This commit is contained in:
parent
7f2fa0817e
commit
37a75f051d
|
@ -155,8 +155,7 @@
|
||||||
"commands": ["plus"],
|
"commands": ["plus"],
|
||||||
"aliases": {
|
"aliases": {
|
||||||
"plus": "more"
|
"plus": "more"
|
||||||
},
|
}
|
||||||
"shortcut": "+"
|
|
||||||
},
|
},
|
||||||
"randomchoice": {
|
"randomchoice": {
|
||||||
"commands": ["choose"],
|
"commands": ["choose"],
|
||||||
|
|
|
@ -20,16 +20,12 @@ class PlusPlugin(Plugin):
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
super().__init__(bot)
|
super().__init__(bot)
|
||||||
self.handlers = {}
|
self.handlers = {}
|
||||||
self.shortcut = self.config.get("shortcut")
|
|
||||||
|
|
||||||
def on_pubmsg(self, event):
|
def on_pubmsg(self, event):
|
||||||
if (
|
if not self.should_handle_command(event.arguments[0], no_content=True):
|
||||||
(self.shortcut and event.arguments[0].strip() == self.shortcut)
|
return False
|
||||||
or self.should_handle_command(event.arguments[0], no_content=True)
|
self.process_handler(event)
|
||||||
):
|
return True
|
||||||
self.process_handler(event)
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def process_handler(self, event):
|
def process_handler(self, event):
|
||||||
if handler := self.handlers.pop(event.target, None):
|
if handler := self.handlers.pop(event.target, None):
|
||||||
|
|
Loading…
Reference in a new issue