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:
parent
f97eceb395
commit
eb456f0123
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue