Mercurial > xib
changeset 207:a97a7e930697
added optionnal "message" argument to Bot.restart()
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sat, 06 Mar 2010 15:39:22 +0100 |
parents | ba5ecd71065f |
children | 1cae0d82501b |
files | bot.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/bot.py +++ b/bot.py @@ -867,10 +867,10 @@ class Bot(threading.Thread): return commands.execute(self, message, bot_admin, bridge) - def restart(self): + def restart(self, message='Restarting bot'): # Stop the bridges for b in self.bridges: - b.stop(message='Restarting bot', log=False) + b.stop(message=message, log=False) # Reopen the bot's XMPP connection self.reopen_xmpp_connection(self.xmpp_c) @@ -879,7 +879,7 @@ class Bot(threading.Thread): for b in self.bridges: b.init2() - self.error(-1, 'Bot restarted.', send_to_admins=True) + self.error(-1, 'Bot restarted with message: '+message, send_to_admins=True) def restart_bridges_delayed(self, bridges, delay, error, protocol='xmpp'):