add !unsilence

This commit is contained in:
jesopo 2019-09-09 18:06:37 +01:00
parent 0c5171a44f
commit 6d176a6aa1

View file

@ -38,6 +38,20 @@ class Module(ModuleManager.BaseModule):
event["target"].set_setting("silence-until", silence_until)
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)
def preprocess_command(self, event):
if event["is_channel"] and not event["hook"].get_kwarg(