]> jfr.im git - erebus.git/commitdiff
control - add message when !die used
authorzonidjan <redacted>
Tue, 13 Sep 2016 09:34:12 +0000 (04:34 -0500)
committerzonidjan <redacted>
Tue, 13 Sep 2016 09:34:12 +0000 (04:34 -0500)
bot.py
modules/control.py

diff --git a/bot.py b/bot.py
index 63ccecb701592ae1d4617e22e5af0ecadcef39bf..697638f7e8851e7db9fa9085d55592651a7b748f 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -105,7 +105,7 @@ class Bot(object):
                                del self.parent.users[oldnick.lower()]
                        self.parent.users[newnick.lower()].nickchange(newnick)
 
-               elif pieces[0] == "ERROR":
+               elif pieces[0] == "ERROR": #TODO handle better
                        sys.exit(2)
                        os._exit(2)
 
index e19670280bfcd14d35caac16a402bbbbf1cf4ac2..c03b8f3445de66811eff3b9a69a9329ec05bef75 100644 (file)
@@ -23,6 +23,10 @@ import ctlmod
 
 @lib.hook(needchan=False, glevel=lib.MANAGER)
 def die(bot, user, chan, realtarget, *args):
+       for botitem in bot.parent.bots.itervalues():
+               for chan in botitem.chans:
+                       chan.fastmsg("Bot is restarting! %s" % ' '.join(args))
+               bot.conn.send("QUIT :Restarting.")
        sys.exit(0)
        os._exit(0)