From dbfc04a9368b4572f4f8d34f0b98d11a1c07a94d Mon Sep 17 00:00:00 2001 From: adator <85586985+adator85@users.noreply.github.com> Date: Tue, 20 Aug 2024 02:24:11 +0200 Subject: [PATCH] V5.0.4 - Delete a user when a user has been kicked --- mods/mod_votekick.py | 7 ++++--- version.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/mod_votekick.py b/mods/mod_votekick.py index 4545ef4..e43ad48 100644 --- a/mods/mod_votekick.py +++ b/mods/mod_votekick.py @@ -157,7 +157,7 @@ def db_add_vote_channel(self, channel:str) -> bool: mes_donnees = {'channel': channel} response = self.Base.db_execute_query("SELECT id FROM votekick_channel WHERE channel = :channel", mes_donnees) - + isChannelExist = response.fetchone() if isChannelExist is None: @@ -198,7 +198,7 @@ def join_saved_channels(self) -> None: self.Irc.send2socket(f":{self.Config.SERVEUR_ID} SJOIN {unixtime} {chan} + :{self.Config.SERVICE_ID}") self.Irc.send2socket(f":{self.Config.SERVICE_NICKNAME} SAMODE {chan} +o {self.Config.SERVICE_NICKNAME}") - return None + return None def is_vote_ongoing(self, channel: str) -> bool: @@ -207,7 +207,7 @@ def is_vote_ongoing(self, channel: str) -> bool: if vote.channel_name == channel: if vote.target_user: response = True - + return response def timer_vote_verdict(self, channel: str) -> None: @@ -220,6 +220,7 @@ def timer_vote_verdict(self, channel: str) -> None: if chan.vote_for > chan.vote_against: self.Irc.send2socket(f':{dnickname} PRIVMSG {channel} :The user {self.Config.CONFIG_COLOR["gras"]}{target_user}{self.Config.CONFIG_COLOR["nogc"]} will be kicked from this channel') self.Irc.send2socket(f":{dnickname} KICK {channel} {target_user} Following the vote, you are not welcome in {channel}") + self.Channel.delete_user_from_channel(channel, self.User.get_uid(target_user)) elif chan.vote_for <= chan.vote_against: self.Irc.send2socket(f':{dnickname} PRIVMSG {channel} :This user will stay on this channel') diff --git a/version.json b/version.json index c39ceb7..7cad28f 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "5.0.3" + "version": "5.0.4" } \ No newline at end of file