示例#1
0
 def test_removing_formatting(self):
     self.assertEqual(formatting.remove_formatting_codes('Lol \x03cool \x032tests\x0f!', irc=True),
                      'Lol cool tests!')
     self.assertEqual(formatting.remove_formatting_codes('Lol $c[]cool $c[blue]tests$r!'),
                      'Lol cool tests!')
     self.assertEqual(formatting.remove_formatting_codes('Lol $ccoo$c3,15l $c12,15tests$r!$$y'),
                      'Lol cool tests!$y')
     self.assertEqual(formatting.remove_formatting_codes('Lol co${yolo}ol ${$}tests!$'),
                      'Lol cool $tests!')
示例#2
0
 def test_removing_formatting(self):
     self.assertEqual(formatting.remove_formatting_codes('Lol \x03cool \x032tests\x0f!', irc=True),
                      'Lol cool tests!')
     self.assertEqual(formatting.remove_formatting_codes('Lol $c[]cool $c[blue]tests$r!'),
                      'Lol cool tests!')
     self.assertEqual(formatting.remove_formatting_codes('Lol $ccoo$c3,15l $c12,15tests$r!$$y'),
                      'Lol cool tests!$y')
     self.assertEqual(formatting.remove_formatting_codes('Lol co${yolo}ol ${$}tests!$'),
                      'Lol cool $tests!')
示例#3
0
    def handle_reactor_pubactions(self, event):
        if event['source'].is_me:
            return
        if event['target'].name in self.dispatch_channels:
            info = {
                'type': 'message',
                'service': 'irc',
                'channel': event['channel'],
                'source': event['source'],
                'message': remove_formatting_codes(event['message']),
            }

            self.events.dispatch('irc action', info)
示例#4
0
文件: irc.py 项目: bibanon/itabashi
    def handle_reactor_pubactions(self, event):
        if event['source'].is_me:
            return
        if event['target'].name in self.dispatch_channels:
            info = {
                'type': 'message',
                'service': 'irc',
                'channel': event['channel'],
                'source': event['source'],
                'message': remove_formatting_codes(event['message']),
            }

            self.events.dispatch('irc action', info)