Exemplo n.º 1
0
 def noticed(self, user, channel, msg):
     info = glob.str_to_tuple(user)
     if channel[0] in self.supported.getFeature("CHANTYPES"):
         ch = self.getChannel(channel)
         u = ch.getOrCreateUser(user)
         self.events.dispatchEvent(name="ChannelNotice", event=Event(channel=ch, user=u, message=msg))
         print "N %s: <%s> %s" % (channel, u, msg)
     elif channel == self.nickname:
         self.events.dispatchEvent(name="PrivateNotice", event=Event(user=self.getOrCreateUser(user), message=msg))
         print "N <%s> %s" % (info[0], msg)
Exemplo n.º 2
0
 def privmsg(self, user, channel, msg):
     info = glob.str_to_tuple(user)
     if channel[0] in self.supported.getFeature("CHANTYPES"):
         ch = self.getChannel(channel)
         u = ch.getOrCreateUser(user)
         self.events.dispatchEvent(name="ChannelMsg", event=Event(channel=ch, user=u, message=msg))
         print "%s: <%s> %s" % (channel, u, msg)
     elif channel == self.nickname:
         self.events.dispatchEvent(name="PrivateMsg", event=Event(user=self.getOrCreateUser(user), message=msg))
         print "<%s> %s" % (info[0], msg)
     else:
         print "Unrecognized target type: {}".format(channel)
Exemplo n.º 3
0
 def noticed(self, user, channel, msg):
     info = glob.str_to_tuple(user)
     if channel[0] in self.supported.getFeature("CHANTYPES"):
         ch = self.getChannel(channel)
         u = ch.getOrCreateUser(user)
         self.events.dispatchEvent(name="ChannelNotice",
                                   event=Event(channel=ch,
                                               user=u,
                                               message=msg))
         print "N %s: <%s> %s" % (
             channel,
             u,
             msg,
         )
     elif channel == self.nickname:
         self.events.dispatchEvent(name="PrivateNotice",
                                   event=Event(
                                       user=self.getOrCreateUser(user),
                                       message=msg))
         print "N <%s> %s" % (info[0], msg)
Exemplo n.º 4
0
 def privmsg(self, user, channel, msg):
     info = glob.str_to_tuple(user)
     if channel[0] in self.supported.getFeature("CHANTYPES"):
         ch = self.getChannel(channel)
         u = ch.getOrCreateUser(user)
         self.events.dispatchEvent(name="ChannelMsg",
                                   event=Event(channel=ch,
                                               user=u,
                                               message=msg))
         print "%s: <%s> %s" % (
             channel,
             u,
             msg,
         )
     elif channel == self.nickname:
         self.events.dispatchEvent(name="PrivateMsg",
                                   event=Event(
                                       user=self.getOrCreateUser(user),
                                       message=msg))
         print "<%s> %s" % (info[0], msg)
     else:
         print "Unrecognized target type: {}".format(channel)