diff options
| author | 2019-05-15 16:48:20 +0100 | |
|---|---|---|
| committer | 2019-05-15 16:48:20 +0100 | |
| commit | 94d2f103b05acd9e4dd67ca039020318f7fd44b0 (patch) | |
| tree | 03b56ceb4746ba882e003785ad772b597ea51f9d /modules | |
| parent | Don'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')
| -rw-r--r-- | modules/ducks.py | 6 |
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) |
