def userQuit(self, user, reason): for channel in self.channels: #TODO: figure out which channels the user is in handle_message( make_context( protocol=self.factory, source=self.network+channel, name=None, body="[IRC] %s quit (%s)" % (user, reason), isFormatted=True, ) )
def userKicked(self, user, channel, kicker, reason): if channel in self.channels: handle_message( make_context( protocol=self.factory, source=self.network+channel, name=None, body="[IRC] <%s> %s was kicked by %s (%s)" % (channel, user, kicker, reason), isFormatted=True, ) )
def userLeft(self, user, channel): if channel in self.channels: handle_message( make_context( protocol=self.factory, source=self.network+channel, name=None, body="[IRC] <%s> %s left" % (channel, user,), isFormatted=True, ) )
def userRenamed(self, old, new): for channel in self.channels: #TODO: figure out which channels the user is in handle_message( make_context( protocol=self.factory, source=self.network+channel, name=None, body="[IRC] %s changed name to %s" % (old, new), isFormatted=True, ) )
def message_handler(self, msg, status): if status == skype4py.cmsReceived: context = make_context( protocol=self, source=msg.ChatName, name=msg.FromDisplayName, body=msg.Body, skypeHandle=msg.FromHandle, isEmote=msg.Type == skype4py.cmeEmoted, ) reactor.callFromThread(handle_message, context)
def message_handler(self, msg, status): if status == skype4py.cmsReceived: emote = False if msg.Type == skype4py.cmeEmoted: emote = True handle_message( make_context( protocol=self, source=msg.ChatName, name=msg.FromDisplayName, body=msg.Body, skypeHandle=msg.FromHandle, isEmote=emote, ) )
def privmsg(self, user, channel, message, action=False): name = user.split("!")[0] isGlobal = (channel in self.channels) if channel in self.channels: source = channel else: source = '!' + name handle_message( make_context( protocol=self.factory, source=self.network + source, name=name, body=message, isEmote=action, isGlobal=isGlobal, ) )