Change duck-triggering to be through regex commands that catch ALL messages;
this will make is-silenced and ignores work automatically
This commit is contained in:
parent
74c3d3a009
commit
7e3375cfbd
1 changed files with 6 additions and 7 deletions
|
@ -44,16 +44,15 @@ class Module(ModuleManager.BaseModule):
|
||||||
if show_duck:
|
if show_duck:
|
||||||
self._trigger_duck(channel)
|
self._trigger_duck(channel)
|
||||||
|
|
||||||
@utils.hook("received.message.channel",
|
@utils.hook("command.regex")
|
||||||
priority=EventManager.PRIORITY_MONITOR)
|
|
||||||
def channel_message(self, event):
|
def channel_message(self, event):
|
||||||
self._activity(event["channel"])
|
"""
|
||||||
|
:pattern: .+
|
||||||
|
:command: duck-trigger
|
||||||
|
"""
|
||||||
|
self._activity(event["target"])
|
||||||
|
|
||||||
def _trigger_duck(self, channel):
|
def _trigger_duck(self, channel):
|
||||||
is_silenced_f = self.exports.get_one("is-silenced", lambda _: False)
|
|
||||||
if is_silenced_f(channel):
|
|
||||||
return
|
|
||||||
|
|
||||||
channel.duck_lines = 0
|
channel.duck_lines = 0
|
||||||
channel.duck_active = True
|
channel.duck_active = True
|
||||||
channel.send_message(DUCK)
|
channel.send_message(DUCK)
|
||||||
|
|
Loading…
Reference in a new issue