From: zonidjan Date: Tue, 17 Nov 2015 12:21:38 +0000 (-0600) Subject: added control module, with !die, to stop bot X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/e2b30093ef228977bdb2ad4edfaa3ee14695b3fe added control module, with !die, to stop bot --- diff --git a/modules/control.py b/modules/control.py new file mode 100644 index 0000000..0448c49 --- /dev/null +++ b/modules/control.py @@ -0,0 +1,27 @@ +# Erebus IRC bot - Author: Erebus Team +# !EVAL and !EXEC commands +# This file is released into the public domain; see http://unlicense.org/ + +# module info +modinfo = { + 'author': 'Erebus Team', + 'license': 'public domain', + 'compatible': [1], + 'depends': [], +} + +# preamble +import modlib +lib = modlib.modlib(__name__) +modstart = lib.modstart +modstop = lib.modstop + +# module code +import sys +import ctlmod + + +@lib.hook('die', needchan=False, glevel=lib.MANAGER) +def cmd_die(bot, user, chan, realtarget, *args): + sys.exit(0) + os._exit(0)