Mercurial > xib
comparison bot.py @ 127:db3f648a9e9e
bot → Bot
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Thu, 14 Jan 2010 10:47:02 +0100 |
parents | eb65b875be0a |
children | b13ca9cefe1c |
comparison
equal
deleted
inserted
replaced
126:eb65b875be0a | 127:db3f648a9e9e |
---|---|
877 ret += '\nparticipants on IRC ('+str(len(irc_participants_nicknames))+'): '+' '.join(irc_participants_nicknames) | 877 ret += '\nparticipants on IRC ('+str(len(irc_participants_nicknames))+'): '+' '.join(irc_participants_nicknames) |
878 if b.irc_connection == None: | 878 if b.irc_connection == None: |
879 ret += ' - this bridge is stopped, use "restart-bridge '+str(i+1)+'" to restart it' | 879 ret += ' - this bridge is stopped, use "restart-bridge '+str(i+1)+'" to restart it' |
880 return ret | 880 return ret |
881 | 881 |
882 elif command in bot.admin_commands: | 882 elif command in Bot.admin_commands: |
883 if bot_admin == False: | 883 if bot_admin == False: |
884 return 'You have to be a bot admin to use this command.' | 884 return 'You have to be a bot admin to use this command.' |
885 | 885 |
886 if command == 'add-bridge': | 886 if command == 'add-bridge': |
887 parser = ArgumentParser(prog=command) | 887 parser = ArgumentParser(prog=command) |
956 elif command == 'stop-bridge': | 956 elif command == 'stop-bridge': |
957 b.stop() | 957 b.stop() |
958 return 'Bridge stopped.' | 958 return 'Bridge stopped.' |
959 | 959 |
960 else: | 960 else: |
961 ret = 'Error: "'+command+'" is not a valid command.\ncommands: '+' '.join(bot.commands) | 961 ret = 'Error: "'+command+'" is not a valid command.\ncommands: '+' '.join(Bot.commands) |
962 if bot_admin == True: | 962 if bot_admin == True: |
963 return ret+'\n'+'admin commands: '+' '.join(bot.admin_commands) | 963 return ret+'\n'+'admin commands: '+' '.join(Bot.admin_commands) |
964 else: | 964 else: |
965 return ret | 965 return ret |
966 | 966 |
967 | 967 |
968 def restart(self): | 968 def restart(self): |