aboutsummaryrefslogtreecommitdiff
path: root/modules/ducks.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-05-15 16:48:20 +0100
committerGravatar jesopo2019-05-15 16:48:20 +0100
commit94d2f103b05acd9e4dd67ca039020318f7fd44b0 (patch)
tree03b56ceb4746ba882e003785ad772b597ea51f9d /modules/ducks.py
parentDon't collect `preprocess.command` errors after we get a HARD_FAIL (diff)
signature
Don't show ducks when the bot is silenced
Diffstat (limited to 'modules/ducks.py')
-rw-r--r--modules/ducks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/ducks.py b/modules/ducks.py
index 01b46457..072bbb57 100644
--- a/modules/ducks.py
+++ b/modules/ducks.py
@@ -38,7 +38,6 @@ class Module(ModuleManager.BaseModule):
show_duck = random.SystemRandom().randint(1, 20) == 1
if show_duck:
- channel.duck_lines = 0
self._trigger_duck(channel)
@utils.hook("received.join")
@@ -50,6 +49,11 @@ class Module(ModuleManager.BaseModule):
self._activity(event["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_active = True
channel.send_message(DUCK)