add !unsilence
This commit is contained in:
parent
0c5171a44f
commit
6d176a6aa1
1 changed files with 14 additions and 0 deletions
|
@ -38,6 +38,20 @@ 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("received.command.unsilence")
|
||||||
|
@utils.kwarg("help", "Unsilence me")
|
||||||
|
@utils.kwarg("unsilence", True)
|
||||||
|
@utils.kwarg("channel_only", True)
|
||||||
|
@utils.kwarg("require_mode", "high")
|
||||||
|
@utils.kwarg("permission", "unsilence")
|
||||||
|
def unsiltence(self, event):
|
||||||
|
silence_until = event["target"].get_setting("silence-until", None)
|
||||||
|
if not silence_until == None:
|
||||||
|
event["target"].del_setting("silence-until")
|
||||||
|
event["stdout"].write("Ok. I've been unsilenced")
|
||||||
|
else:
|
||||||
|
event["stderr"].write("I am not silenced")
|
||||||
|
|
||||||
@utils.hook("preprocess.command", priority=EventManager.PRIORITY_HIGH)
|
@utils.hook("preprocess.command", priority=EventManager.PRIORITY_HIGH)
|
||||||
def preprocess_command(self, event):
|
def preprocess_command(self, event):
|
||||||
if event["is_channel"] and not event["hook"].get_kwarg(
|
if event["is_channel"] and not event["hook"].get_kwarg(
|
||||||
|
|
Loading…
Reference in a new issue