def handleCmd_KICK(self, prefix, args): chan = args[0] l33t = prefix n00b = args[1] reason = irc_strip(args[2]) scfg = getServiceConfig() if chan != scfg.channel: return # Rejoin the bot if it's killed. if self.ism.isMyBot(n00b): if self.ism.syncd: self.pushBotJoin() return l33t = self.ism.findUser(l33t).inick n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, reason) else: n00b_u = self.ism.findUser(n00b) message = ( "%s has kicked %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b_u.inick), reason)) CHECK(self.ism.partChannel(n00b_u, message))
def handleCmd_KILL(self, prefix, args): l33t = prefix n00b = args[0] reason = irc_strip(args[1]) # In most cases, n00b is a UUID, but Anope seems to still use a nick. # Thus, we have to try both everywhere :-/ # Reconnect the bot if it's killed. if self.ism.isMyBot(n00b): if self.ism.syncd: self.pushBotJoin(do_nick=True) return l33t = self.ism.findUser(l33t).inick # If n00b is a Dtella node, kick 'em. n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode( n, l33t, "KILL: " + reason, send_quit=False) return # If n00b is an IRC user, treat it like a QUIT. try: n00b_u = self.ism.findUser(n00b) except KeyError: LOG.warning("Tried to KILL unknown user: %s" % n00b) return message = ( "%s has KILL'd %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b_u.inick), reason)) self.ism.removeUser(n00b_u, message)
def handleCmd_KILL(self, prefix, args): l33t = prefix n00b = args[0] reason = irc_strip(args[1]) # In most cases, n00b is a UUID, but Anope seems to still use a nick. # Thus, we have to try both everywhere :-/ # Reconnect the bot if it's killed. if self.ism.isMyBot(n00b): if self.ism.syncd: self.pushBotJoin(do_nick=True) return l33t = self.ism.findUser(l33t).inick # If n00b is a Dtella node, kick 'em. n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, "KILL: " + reason, send_quit=False) return # If n00b is an IRC user, treat it like a QUIT. try: n00b_u = self.ism.findUser(n00b) except KeyError: LOG.warning("Tried to KILL unknown user: %s" % n00b) return message = ("%s has KILL'd %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b_u.inick), reason)) self.ism.removeUser(n00b_u, message)
def handleCmd_KICK(self, prefix, args): chan = args[0] l33t = prefix n00b = args[1] reason = irc_strip(args[2]) scfg = getServiceConfig() if chan != scfg.channel: return # Rejoin the bot if it's killed. if self.ism.isMyBot(n00b): if self.ism.syncd: self.pushBotJoin() return l33t = self.ism.findUser(l33t).inick n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, reason) else: n00b_u = self.ism.findUser(n00b) message = ("%s has kicked %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b_u.inick), reason)) CHECK(self.ism.partChannel(n00b_u, message))
def handleCmd_KILL(self, prefix, args): # :darkhorse KILL }darkhorse :dhirc.com!darkhorse (TEST!!!) l33t = prefix n00b = args[0] reason = "KILL: " + irc_strip(args[1]) if n00b.lower() == self.ism.bot_user.inick.lower(): if self.ism.syncd: self.pushBotJoin(do_nick=True) return n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, reason, send_quit=False) else: message = "%s has KILL'd %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b), reason) self.ism.removeUser(self.ism.findUser(n00b), message)
def handleCmd_KILL(self, prefix, args): # :darkhorse KILL }darkhorse :dhirc.com!darkhorse (TEST!!!) l33t = prefix n00b = args[0] reason = "KILL: " + irc_strip(args[1]) if n00b.lower() == self.ism.bot_user.inick.lower(): if self.ism.syncd: self.pushBotJoin(do_nick=True) return n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, reason, send_quit=False) else: message = ("%s has KILL'd %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b), reason)) self.ism.removeUser(self.ism.findUser(n00b), message)
def handleCmd_SVSNICK(self, prefix, args): # :services.dhirc.com SVSNICK |foo Guest33400 :1236660594 oldnick = args[0] newnick = args[1] # Is the source user a Dtella node? Freak out. n = self.ism.findDtellaNode(inick=oldnick) if n: message = "Nick change to %s is impossible" % irc_to_dc(newnick) self.ism.kickDtellaNode(n, prefix, message)
def handleCmd_KICK(self, prefix, args): chan = args[0] l33t = prefix n00b = args[1] reason = irc_strip(args[2]) scfg = getServiceConfig() if chan != scfg.channel: return if n00b.lower() == self.ism.bot_user.inick.lower(): if self.ism.syncd: self.pushBotJoin() return n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, reason) else: message = "%s has kicked %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b), reason) CHECK(self.ism.partChannel(self.ism.findUser(n00b), message))
def handleCmd_KICK(self, prefix, args): chan = args[0] l33t = prefix n00b = args[1] reason = irc_strip(args[2]) scfg = getServiceConfig() if chan != scfg.channel: return if n00b.lower() == self.ism.bot_user.inick.lower(): if self.ism.syncd: self.pushBotJoin() return n = self.ism.findDtellaNode(inick=n00b) if n: self.ism.kickDtellaNode(n, l33t, reason) else: message = ("%s has kicked %s: %s" % (irc_to_dc(l33t), irc_to_dc(n00b), reason)) CHECK(self.ism.partChannel(self.ism.findUser(n00b), message))