# HG changeset patch # User Charly COSTE # Date 1267886362 -3600 # Node ID a97a7e930697053213a85143e6c0c8b8ad0ee561 # Parent ba5ecd71065f52e597f53e8f8570b0da5037cf37 added optionnal "message" argument to Bot.restart() Signed-off-by: Charly COSTE diff --git a/bot.py b/bot.py --- 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'):