def floodkick(self, cli, chan, nick, source): if self.users[chan][client.parse_nick(source)[4]]['kicked'] is False: self.users[chan][client.parse_nick(source)[4]]['kicked'] = True cli.kick(chan, nick, "No hagas flood.") else: cli.mode(chan, "+b *!*@" + client.parse_nick(source)[4]) cli.kick(chan, nick, "No hagas flood.") time.sleep(900) cli.mode(chan, "-b *!*@" + client.parse_nick(source)[4])
def floodkick(self, cli, chan, nick, source): if self.inmucheck(self.core, cli, nick, chan): return if self.users[chan][client.parse_nick(source)[4]]['kicked'] is False: self.users[chan][client.parse_nick(source)[4]]['kicked'] = True cli.kick(chan, nick, "No hagas flood.") else: cli.mode(chan, "+b *!*@" + client.parse_nick(source)[4]) cli.kick(chan, nick, "No hagas flood.") time.sleep(900) cli.mode(chan, "-b *!*@" + client.parse_nick(source)[4])
def modeprot(self, cli, ev): c = autodeopt.get(autodeopt.channel == ev.target) if c is False: return 1 if client.parse_nick(ev.source)[1] == cli.nickname: return 1 x = self.parsemode(cli, ev) for w in x: if w == cli.nickname: continue cli.mode(ev.target, "-o " + w)
def pubmsghandle(self, cli, ev): source = ev.source2 try: self.chans[ev.target] except: return 0 try: try: self.users[ev.target] except KeyError: self.users[ev.target] = {} self.users[ev.target][client.parse_nick(source)[4]] except KeyError: self.users[ev.target][client.parse_nick(source)[4]] = {} self.users[ev.target][client.parse_nick(source) [4]]['kicked'] = False self.users[ev.target][client.parse_nick(source)[4]]['firstmsg'] = 0 self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] = 0 if self.users[ev.target][client.parse_nick(source) [4]]['firstmsg'] == 0: self.users[ev.target][client.parse_nick(source) [4]]['firstmsg'] = time.time() self.users[ev.target][client.parse_nick(source) [4]]['msgcount'] += 1 else: if (time.time() - self.users[ev.target][client.parse_nick( source)[4]]['firstmsg']) >= self.chans[ev.target]['sec']: self.users[ev.target][client.parse_nick(source) [4]]['firstmsg'] = 0 self.users[ev.target][client.parse_nick(source) [4]]['msgcount'] = 0 else: if self.users[ev.target][client.parse_nick(source)[4]][ 'msgcount'] >= self.chans[ev.target]['msg']: self.users[ev.target][client.parse_nick(source) [4]]['firstmsg'] = 0 self.users[ev.target][client.parse_nick(source) [4]]['msgcount'] = 0 self.floodkick(cli, ev.target, ev.source, ev.source2) self.users[ev.target][client.parse_nick(source) [4]]['msgcount'] += 1
def pubmsghandle(self, cli, ev): source = ev.source2 try: self.chans[ev.target] except: return 0 try: try: self.users[ev.target] except KeyError: self.users[ev.target] = {} self.users[ev.target][client.parse_nick(source)[4]] except KeyError: self.users[ev.target][client.parse_nick(source)[4]] = {} self.users[ev.target][client.parse_nick(source)[4]]['kicked'] = False self.users[ev.target][client.parse_nick(source)[4]]['firstmsg'] = 0 self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] = 0 if self.users[ev.target][client.parse_nick(source)[4]]['firstmsg'] == 0: self.users[ev.target][client.parse_nick(source)[4]]['firstmsg'] = time.time() self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] += 1 else: if (time.time() - self.users[ev.target][client.parse_nick(source)[4]]['firstmsg']) >= self.chans[ev.target]['sec']: self.users[ev.target][client.parse_nick(source)[4]]['firstmsg'] = 0 self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] = 0 else: if self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] >= self.chans[ev.target]['msg']: self.users[ev.target][client.parse_nick(source)[4]]['firstmsg'] = 0 self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] = 0 self.floodkick(cli, ev.target, ev.source, ev.source2) self.users[ev.target][client.parse_nick(source)[4]]['msgcount'] += 1