Пример #1
0
 def onCommand(self):
     if not self.dialog.inBanUser(self.aimed):
         self.dialog.msg(text=getError("userNotBan").format(self.aimed.ping()))
         return
     self.dialog.unBanUser(self.aimed)
     self.dialog.msg(text=getInfraction("userUnBan").format(self.sender.getRank().getName(), self.sender.ping(),
                                                            self.aimed.getRank().getName(), self.aimed.ping()))
Пример #2
0
 def onCommand(self):
     self.dialog.msg(text=getInfraction("userKick").format(
         self.sender.getRank().getName(), self.sender.ping(),
         self.aimed.getRank().getName(), self.aimed.ping(),
         getReason(self.args)))
     DB().createLogs(self.aimed, self.sender, "kick", 0,
                     getReason(self.args))
     self.dialog.kickUser(self.aimed)
Пример #3
0
 def onCommand(self):
     dialogsList = getAllDialogs()
     self.aimed.setBalckList()
     self.dialog.msg(
         text=getInfraction("userAddBlackList").format(self.sender.getRank().getName(), self.sender.ping(),
                                                       self.aimed.getRank().getName(), self.aimed.ping()))
     self.dialog.kickUser(self.aimed)
     for i in dialogsList:
         i.kickUser(self.aimed)
     DB().createLogs(self.aimed, self.sender, "back_list", 0, "NONE")
Пример #4
0
 def onCommand(self):
     if self.aimed.inBlackList():
         self.aimed.delBalckList()
     for i in getAllDialogs():
         if i.inBanUser(self.aimed):
             i.unBanUser(self.aimed)
         if i.inMuteUser(self.aimed):
             i.unMuteUser(self.aimed)
     self.dialog.msg(text=getInfraction("pardonUser").format(
         self.sender.getRank().getName(), self.sender.ping(),
         self.aimed.ping()))
Пример #5
0
 def onCommand(self):
     secondDialogList = getAllDialogs()
     self.aimed.setRank(0)
     for i in secondDialogList:
         if i.getType() == 'staff':
             i.msg(text=getInfraction("staffKick").format(
                 self.sender.getRank().getName(), self.sender.ping(),
                 self.aimed.ping()))
             i.kickUser(self.aimed)
     DB().createLogs(self.aimed, self.sender, "staff_kick", 0,
                     "Более не является персоналом проекта")
Пример #6
0
 def onCommand(self):
     time = getInfractionTime(self.args[0])
     if not time:
         self.dialog.msg(
             text=getError("timeError").format(self.sender.ping()))
         return
     if self.dialog.inBanUser(self.aimed):
         self.dialog.msg(
             text=getError("userAlreadyBan").format(self.aimed.ping()))
         return
     if violationLimits(self.sender, time):
         self.dialog.msg(text=getError("rankLimit").format(
             self.sender.getRank().getName(), self.sender.ping(),
             self.sender.getRank().getInfractionLimit()))
         return
     self.dialog.banUser(self.aimed, time)
     DB().createLogs(self.aimed, self.sender, "ban", time,
                     getReason(self.args[1:]))
     self.dialog.msg(text=getInfraction("userBan").format(
         self.sender.getRank().getName(), self.sender.ping(),
         self.aimed.getRank().getName(), self.aimed.ping(), self.args[0],
         getReason(self.args[1:])))
     self.dialog.kickUser(self.aimed)
Пример #7
0
 def firstLevel(self):
     if not self.dialog.inActivate():
         self.dialog.msg(text=getError("dialogNotActivate"))
         return
     # Получем пользователя
     if 'action' in self.obj['message'].keys(
     ) and self.obj['message']['action']['type'] == 'chat_invite_user':
         inviteU = True
         userinvite = User(id=self.obj['message']['from_id'])
         user = User(id=self.obj['message']['action']['member_id'])
     else:
         inviteU = False
         userinvite = ''
         user = User(id=self.obj['message']['from_id'])
     userInviteInDialog = False
     if 'action' in self.obj['message'].keys():
         if self.obj['message']['action'][
                 'type'] == 'chat_invite_user' or self.obj['message'][
                     'action']['type'] == 'chat_invite_user_by_link':
             userInviteInDialog = True
             #self.dialog.msg(text=getSpecial("inviteUser").format(user.ping()))
             pass
         elif self.obj['message']['action']['type'] == 'chat_kick_user':
             if self.dialog == 'staff':
                 sType = 'leaveUserStaff'
                 self.dialog.kickUser(user)
             else:
                 sType = 'leaveUser'
             self.dialog.msg(text=getSpecial(sType).format(user.ping()))
             return
     # Проверяем пользовотеля на чс
     if user.inBlackList():
         self.dialog.msg(
             text=getInfraction("userInBlackList").format(user.ping()))
         self.dialog.kickUser(user)
         if self.dialog.inSilenceMode():
             self.dialog.msg(text=getInfo("silenceModeInDialogAlarm").
                             format(self.dialog.getTextSilenceMode()))
         return
     # Проверка на МУТ
     if self.dialog.inMuteUser(user):
         if inviteU:
             if Rank(userinvite).canRazMute():
                 self.dialog.msg(
                     text=getInfraction("userUnMuteByInvite").format(
                         user.ping(),
                         userinvite.getRank().getName(), userinvite.ping()))
                 self.dialog.unMuteUser(user)
                 return
         self.dialog.msg(
             text=getInfraction("userViolatedMute").format(user.ping()))
         self.dialog.kickUser(user)
         if self.dialog.inSilenceMode():
             self.dialog.msg(text=getInfo("silenceModeInDialogAlarm").
                             format(self.dialog.getTextSilenceMode()))
         return
     # Проверка на БАН
     if self.dialog.inBanUser(user):
         if inviteU:
             if Rank(userinvite).canRazBan():
                 self.dialog.msg(
                     text=getInfraction("userUnBanByInvite").format(
                         user.ping(),
                         userinvite.getRank().getName(), userinvite.ping()))
                 self.dialog.unBanUser(user)
         self.dialog.msg(
             text=getInfraction("userViolatedBan").format(user.ping()))
         self.dialog.kickUser(user)
         if self.dialog.inSilenceMode():
             self.dialog.msg(text=getInfo("silenceModeInDialogAlarm").
                             format(self.dialog.getTextSilenceMode()))
         return
     # Проверка на режим молчания
     if self.dialog.inSilenceMode():
         if not user.getRank().canIgnoreSilenceMode(
         ) and not userInviteInDialog:
             self.dialog.muteUser(user, 600)
             self.dialog.msg(
                 text=getInfraction("userViolatedSilenceMode").format(
                     user.getRank().getName(), user.ping()))
             self.dialog.msg(
                 text=getInfo("mute").format(user.ping(), "5 минут"))
             self.dialog.msg(text=getInfo("silenceModeInDialogAlarm").
                             format(self.dialog.getTextSilenceMode()))
             return
     if userInviteInDialog:
         self.dialog.msg(text=getSpecial("inviteUser").format(user.ping()))
     if self.dialog.getType() == 'staff':
         return self.secondLevel(user)
     # Проверка на запрещённые слова
     text = self.obj['message']['text'].split()
     for i in text:
         if i.lower() in SettingsInType('mat'):
             if not user.getRank().canIgnoreMat():
                 self.dialog.muteUser(user, 900)
                 self.dialog.msg(text=getInfraction("userMute").format(
                     "Святой", "Ботя",
                     user.getRank().getName(), user.ping(), "15м",
                     "Использование запрещённых слов"))
                 self.dialog.msg(
                     text=getInfo("mute").format(user.ping(), "15м"))
                 return
     return self.secondLevel(user)