Exemplo n.º 1
0
 def _post_pm_to_irc(self, irc_recipient: str, user_bot: UserBot) -> None:
     for line in self.raw_message['text'].splitlines():
         user_bot.post_to_irc(
             user_bot.msg,
             irc_recipient,
             line,
         )
Exemplo n.º 2
0
 def _post_to_irc(self, channel_name: str, user_bot: UserBot) -> None:
     for line in self.raw_message['text'].splitlines():
         user_bot.post_to_irc(
             user_bot.msg,
             '#' + channel_name,
             line,
         )
Exemplo n.º 3
0
 def _irc_me_action(
     self,
     channel_name: str,
     user_bot: UserBot,
     action: str,
 ) -> None:
     user_bot.post_to_irc(
         user_bot.describe,
         '#' + channel_name,
         action,
     )
Exemplo n.º 4
0
 def buildProtocol(self, addr):
     p = UserBot(
         self.slack_user['name'],
         self.slack_user['real_name'],
         self.slack_user['id'],
         self.channels,
         self.target_group_nick,
         self.nickserv_password,
     )
     p.factory = self
     self.bridge_bot_factory.add_user_bot(p)
     self.resetDelay()
     return p
Exemplo n.º 5
0
 def _post_pm_to_irc(self, irc_recipient: str, user_bot: UserBot) -> None:
     user_bot.post_to_irc(
         user_bot.msg,
         irc_recipient,
         self.raw_message['text'],
     )
Exemplo n.º 6
0
 def _post_to_irc(self, channel_name: str, user_bot: UserBot) -> None:
     user_bot.post_to_irc(
         user_bot.msg,
         '#' + channel_name,
         self.raw_message['text'],
     )
Exemplo n.º 7
0
 def _change_presence(self, user_bot: UserBot) -> None:
     if self.raw_message['presence'] == 'away':
         user_bot.away('Slack user inactive.')
     elif self.raw_message['presence'] == 'active':
         user_bot.back()