mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 19:24:23 +00:00
v5.1.5
This commit is contained in:
@@ -35,7 +35,7 @@ class Command():
|
||||
# Create module commands (Mandatory)
|
||||
self.commands_level = {
|
||||
1: ['join', 'part'],
|
||||
2: ['owner', 'deowner', 'op', 'deop', 'halfop', 'dehalfop', 'voice', 'devoice', 'ban', 'unban','kick', 'kickban', 'umode']
|
||||
2: ['owner', 'deowner', 'op', 'deop', 'halfop', 'dehalfop', 'voice', 'devoice', 'deopall', 'devoiceall', 'voiceall', 'ban', 'unban','kick', 'kickban', 'umode']
|
||||
}
|
||||
|
||||
# Init the module
|
||||
@@ -172,6 +172,26 @@ class Command():
|
||||
|
||||
match command:
|
||||
|
||||
case 'deopall':
|
||||
try:
|
||||
self.Irc.send2socket(f":{service_id} SVSMODE {fromchannel} -o")
|
||||
|
||||
except IndexError as e:
|
||||
self.Logs.warning(f'_hcmd OP: {str(e)}')
|
||||
|
||||
case 'devoiceall':
|
||||
try:
|
||||
self.Irc.send2socket(f":{service_id} SVSMODE {fromchannel} -v")
|
||||
|
||||
except IndexError as e:
|
||||
self.Logs.warning(f'_hcmd OP: {str(e)}')
|
||||
|
||||
case 'voiceall':
|
||||
chan_info = self.Channel.get_Channel(fromchannel)
|
||||
for uid in chan_info.uids:
|
||||
self.Irc.send2socket(f":{service_id} MODE {fromchannel} +v {self.User.get_nickname(self.Base.clean_uid(uid))}")
|
||||
|
||||
|
||||
case 'op':
|
||||
# /mode #channel +o user
|
||||
# .op #channel user
|
||||
|
||||
@@ -218,15 +218,18 @@ class Votekick():
|
||||
|
||||
dnickname = self.Config.SERVICE_NICKNAME
|
||||
|
||||
if not self.is_vote_ongoing(channel):
|
||||
return None
|
||||
|
||||
for chan in self.VOTE_CHANNEL_DB:
|
||||
if chan.channel_name == channel:
|
||||
target_user = self.User.get_nickname(chan.target_user)
|
||||
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} PRIVMSG {channel} :User {self.Config.CONFIG_COLOR["gras"]}{target_user}{self.Config.CONFIG_COLOR["nogc"]} has {chan.vote_against} votes against and {chan.vote_for} votes for. For this reason, it\'ll be kicked from the 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 [{target_user}] will stay on this channel')
|
||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {channel} :User {self.Config.CONFIG_COLOR["gras"]}{target_user}{self.Config.CONFIG_COLOR["nogc"]} has {chan.vote_against} votes against and {chan.vote_for} votes for. For this reason, it\'ll remain in the channel')
|
||||
|
||||
# Init the system
|
||||
if self.init_vote_system(channel):
|
||||
@@ -323,10 +326,10 @@ class Votekick():
|
||||
if chan.channel_name == channel:
|
||||
target_user = self.User.get_nickname(chan.target_user)
|
||||
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} PRIVMSG {channel} :User {self.Config.CONFIG_COLOR["gras"]}{target_user}{self.Config.CONFIG_COLOR["nogc"]} has {chan.vote_against} votes against and {chan.vote_for} votes for. For this reason, it\'ll be kicked from the channel')
|
||||
self.Irc.send2socket(f":{dnickname} KICK {channel} {target_user} Following the vote, you are not welcome in {channel}")
|
||||
elif chan.vote_for <= chan.vote_against:
|
||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {channel} :This user will stay on this channel')
|
||||
self.Irc.send2socket(f':{dnickname} PRIVMSG {channel} :User {self.Config.CONFIG_COLOR["gras"]}{target_user}{self.Config.CONFIG_COLOR["nogc"]} has {chan.vote_against} votes against and {chan.vote_for} votes for. For this reason, it\'ll remain in the channel')
|
||||
|
||||
# Init the system
|
||||
if self.init_vote_system(channel):
|
||||
|
||||
Reference in New Issue
Block a user