Skip to content

Commit

Permalink
Merge pull request #19 from adator85/dev
Browse files Browse the repository at this point in the history
V5.0.4 - Delete a user when a user has been kicked
  • Loading branch information
adator85 authored Aug 20, 2024
2 parents 824db73 + dbfc04a commit 9533b01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mods/mod_votekick.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:

Expand All @@ -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:
Expand All @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "5.0.3"
"version": "5.0.4"
}

0 comments on commit 9533b01

Please sign in to comment.