Set silence.py's preprocess.command hook to PRIORITY_HIGH, so that other

modules can't respond to the event with errors first
This commit is contained in:
jesopo 2019-05-15 16:39:11 +01:00
parent f97eceb395
commit eb456f0123

View file

@ -1,5 +1,5 @@
import time import time
from src import ModuleManager, utils from src import EventManager, ModuleManager, utils
SILENCE_TIME = 60*5 # 5 minutes SILENCE_TIME = 60*5 # 5 minutes
@ -23,7 +23,7 @@ class Module(ModuleManager.BaseModule):
event["target"].set_setting("silence-until", silence_until) event["target"].set_setting("silence-until", silence_until)
event["stdout"].write("Ok, I'll be back") event["stdout"].write("Ok, I'll be back")
@utils.hook("preprocess.command") @utils.hook("preprocess.command", priority=EventManager.PRIORITY_HIGH)
def preprocess_command(self, event): def preprocess_command(self, event):
if event["is_channel"]: if event["is_channel"]:
silence_until = event["target"].get_setting("silence-until", None) silence_until = event["target"].get_setting("silence-until", None)