def testasync(self, txt, timeout=0, kw={}): """ run txt with test ievent. don't close queues on exit.""" txt = txt.strip() ievent = Ircevent() ievent.bot = self ievent.cmnd = 'PRIVMSG' ievent.nick = 'test' ievent.userhost = 'test@test' ievent.origtxt = txt ievent.txt = ievent.origtxt ievent.channel = '#test' ievent.allowqueue = False ievent.closequeue = False if kw: for i, j in kw.iteritems(): setattr(ievent, i, j) if timeout: result = plugins.cmnd(self, ievent, timeout) else: result = plugins.cmnd(self, ievent, 10) rlog(100, self.name, str(result)) return result
partyline.del_party(nick) return try: # see if user provided channel res = strippedtxt(res.strip()) chan = checkchan(self, res) if chan != None: (channel, res) = chan else: channel = nick # create ircevent ievent = Ircevent() ievent.nick = nick ievent.userhost = userhost ievent.channel = channel ievent.origtxt = res ievent.txt = res ievent.cmnd = 'DCC' ievent.bot = self ievent.sock = sock ievent.speed = 1 ievent.isdcc = True # check if its a command if so dispatch if ievent.txt[0] == "!": ievent.txt = ievent.txt[1:] plugins.trydispatch(self, ievent) continue elif ievent.txt[0] == "@": # command is broadcast so send response to the paryline # members partyline.say_broadcast_notself(
partyline.del_party(nick) return try: # see if user provided channel res = strippedtxt(res.strip()) chan = checkchan(self, res) if chan != None: (channel, res) = chan else: channel = nick # create ircevent ievent = Ircevent() ievent.nick = nick ievent.userhost = userhost ievent.channel = channel ievent.origtxt = res ievent.txt = res ievent.cmnd = 'DCC' ievent.bot = self ievent.sock = sock ievent.speed = 1 ievent.isdcc = True # check if its a command if so dispatch if ievent.txt[0] == "!": ievent.txt = ievent.txt[1:] plugins.trydispatch(self, ievent) continue elif ievent.txt[0] == "@": # command is broadcast so send response to the paryline # members partyline.say_broadcast_notself(ievent.nick, "[%s] %s" % (ievent.nick, ievent.txt))