From a4f41cdfd7872c55c7b39bd69d324fc2c937cd23 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Sun, 13 Feb 2022 17:22:14 -0600 Subject: [PATCH] ducks.py: do not accept `,bef` or `,trap` if ducks are disabled --- modules/ducks.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/ducks.py b/modules/ducks.py index eb6d7ef4..22a9bb99 100644 --- a/modules/ducks.py +++ b/modules/ducks.py @@ -98,6 +98,10 @@ class Module(ModuleManager.BaseModule): @utils.kwarg("help", "Befriend a duck") @utils.spec("!-channelonly") def befriend(self, event): + if not event["target"].get_setting("ducks-enabled", False): + return event["stderr"].write( + "Ducks are not enabled in this channel" + ) if event["target"].duck_active: action = self._duck_action(event["target"], event["user"], "befriended", "ducks-befriended") @@ -109,6 +113,10 @@ class Module(ModuleManager.BaseModule): @utils.kwarg("help", "Trap a duck") @utils.spec("!-channelonly") def trap(self, event): + if not event["target"].get_setting("ducks-enabled", False): + return event["stderr"].write( + "Ducks are not enabled in this channel" + ) if event["target"].duck_active: action = self._duck_action(event["target"], event["user"], "trapped", "ducks-shot")