コード例 #1
0
ファイル: IRC.py プロジェクト: 4rChon/gadget
 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,
             )
         )
コード例 #2
0
ファイル: IRC.py プロジェクト: 4rChon/gadget
 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,
             )
         )
コード例 #3
0
ファイル: IRC.py プロジェクト: 4rChon/gadget
 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,
             )
         )
コード例 #4
0
ファイル: IRC.py プロジェクト: 4rChon/gadget
 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,
             )
         )
コード例 #5
0
ファイル: Skype.py プロジェクト: 4rChon/gadget
 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,
             )
         )
コード例 #6
0
ファイル: IRC.py プロジェクト: 4rChon/gadget
 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,
         )
     )