Пример #1
0
 def make_event(self,
                origin,
                channel,
                txt,
                event=None,
                wait=0,
                showall=False,
                nooutput=False,
                cbtype=""):
     """ insert an event into the callbacks chain. """
     if event: e = cpy(event)
     else: e = EventBase(bot=self)
     e.cbtype = cbtype or "CMND"
     e.origin = origin or "test@test"
     e.auth = e.origin
     e.userhost = e.origin
     e.channel = channel
     if 'socket' in repr(channel): e.socket = channel
     e.txt = unicode(txt)
     e.nick = (event and event.nick) or stripident(e.userhost.split('@')[0])
     e.showall = showall
     e.nooutput = nooutput
     e.wait = wait
     e.closequeue = False
     e.bind(self)
     return e
Пример #2
0
 def make_event(self, origin, channel, txt, event=None, wait=0, showall=False, nooutput=False, cbtype=""):
     """ insert an event into the callbacks chain. """
     if event: e = cpy(event)
     else: e = EventBase(bot=self)
     e.cbtype = cbtype or "CMND"
     e.origin = origin or "test@test"
     e.auth = e.origin
     e.userhost = e.origin
     e.channel = channel
     if 'socket' in repr(channel): e.socket = channel
     e.txt = unicode(txt)
     e.nick = (event and event.nick) or stripident(e.userhost.split('@')[0])
     e.showall = showall
     e.nooutput = nooutput
     e.wait = wait
     e.closequeue = False
     e.bind(self)
     return e