From fdccba9bf05967aa0132bc3784180dbfde38665d Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 7 Oct 2018 11:28:51 +0100 Subject: [PATCH] Change modules/signals.py to use bot.trigger(), add a !serverset @utils.export for quit-quote --- modules/signals.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/signals.py b/modules/signals.py index d0226cfa..8e57a9a0 100644 --- a/modules/signals.py +++ b/modules/signals.py @@ -1,6 +1,9 @@ import signal -from src import Config +from src import Config, utils +@utils.export("serverset", {"setting": "quit-quote", + "help": "Set whether I pick a random quote to /quit with", + "validate": utils.bool_or_none}) class Module(object): def __init__(self, bot, events, exports): self.bot = bot @@ -16,9 +19,9 @@ class Module(object): reason = "Leaving" if server.get_setting("quit-quote", True): reason = self.events.on("get.quit-quote" - ).call_for_result(default="Leaving") + ).call_for_result(default=reason) server.send_quit(reason) - self.bot.register_write(server) + self.bot.trigger() self.bot.running = False