From 1da66fb72d4a7fafa7fea0fbb3a06b163d26f223 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 21 Feb 2019 21:14:09 +0000 Subject: [PATCH] Only give users auto_modes they don't already have (auto_mode.py) --- modules/auto_mode.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/auto_mode.py b/modules/auto_mode.py index 1868027f..c6810a6d 100644 --- a/modules/auto_mode.py +++ b/modules/auto_mode.py @@ -14,8 +14,10 @@ class Module(ModuleManager.BaseModule): def _check_modes(self, channel, user): modes = self._get_modes(channel, user) if modes: - channel.send_mode("+%s" % "".join(modes), - [user.nickname for mode in modes]) + current_modes = channel.get_user_status(user) + new_modes = modes-current_modes + channel.send_mode("+%s" % "".join(new_modes), + [user.nickname for mode in new_modes]) @utils.hook("received.join") def on_join(self, event):