comparison bot.py @ 235:533a5db79389

minor fixes in bot.py Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Mon, 08 Mar 2010 00:13:52 +0100
parents 02c58515edde
children 8acbfda313b9
comparison
equal deleted inserted replaced
234:c9c0d9a5e0b8 235:533a5db79389
637 return 637 return
638 638
639 639
640 # Part event 640 # Part event
641 if event.eventtype() == 'part': 641 if event.eventtype() == 'part':
642 if not from_:
643 self.error(say_levels.debug, 'a participant that wasn\'t here left:\n'+event_str)
644 return
642 if len(event.arguments()) > 0: 645 if len(event.arguments()) > 0:
643 leave_message = event.arguments()[0] 646 leave_message = event.arguments()[0]
644 else: 647 else:
645 leave_message = 'Left channel.' 648 leave_message = 'Left channel.'
646 bridge.remove_participant('irc', from_.nickname, leave_message) 649 bridge.remove_participant('irc', from_.nickname, leave_message)
662 665
663 666
664 # Mode event 667 # Mode event
665 if event.eventtype() == 'mode': 668 if event.eventtype() == 'mode':
666 if len(event.arguments()) < 2: 669 if len(event.arguments()) < 2:
667 self.error(2, debug_str, debug=True) 670 self.error(say_levels.debug, '2 arguments are needed for a '+event.eventtype()+' event\n'+event_str)
668 self.error(say_levels.debug, '2 arguments are needed for a '+event.eventtype()+' event', no_debug_add=event_str)
669 return 671 return
670 if event.arguments()[1] != self.nickname or not 'o' in event.arguments()[0]: 672 if event.arguments()[1] != self.nickname or not 'o' in event.arguments()[0]:
671 self.error(1, 'ignoring IRC mode "'+event.arguments()[0]+'" for "'+event.arguments()[1]+'"', debug=True) 673 self.error(1, 'ignoring IRC mode "'+event.arguments()[0]+'" for "'+event.arguments()[1]+'"', debug=True)
672 return 674 return
673 bridge = self.get_bridge(irc_room=event.target(), irc_server=connection.server) 675 bridge = self.get_bridge(irc_room=event.target(), irc_server=connection.server)