From 561dcdf799a54d4c9c5aa58b7b58452ae3ad1a56 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 9 Sep 2018 09:26:56 +0100 Subject: [PATCH] Switch set.py to use delimited events --- modules/set.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/modules/set.py b/modules/set.py index a389cc8b..a9a677ae 100644 --- a/modules/set.py +++ b/modules/set.py @@ -5,25 +5,22 @@ class Module(object): self.bot = bot self.exports = exports - events.on("received").on("command").on("set").hook( - self.set, help="Set a specified user setting", - usage=" ") - events.on("received").on("command").on("get").hook( - self.get, help="Get a specified user setting", - usage="", min_args=1) + events.on("received.command.set").hook(self.set, + usage=" ", help="Set a specified user setting") + events.on("received.command.get").hook(self.get, min_args=1, + usage="", help="Get a specified user setting") - events.on("received").on("command").on("channelset" - ).hook(self.channel_set, channel_only=True, - help="Set a specified setting for the current channel", - usage=" ", require_mode="o") - events.on("received").on("command").on("channelsetoverride" - ).hook(self.channel_set, channel_only=True, - help="Set a specified setting for the current channel", - usage=" ", permission="channelsetoverride") - events.on("received").on("command").on("channelget" - ).hook(self.channel_get, channel_only=True, - help="Get a specified setting for the current channel", - usage="", min_args=1, require_mode="o") + events.on("received.command.channelset").hook(self.channel_set, + channel_only=True, usage=" ", require_mode="o", + help="Set a specified setting for the current channel") + events.on("received.command.channelsetoverride").hook( + self.channel_set, channel_only=True, usage=" ", + permission="channelsetoverride", + help="Set a specified setting for the current channel") + events.on("received.command.channelget").hook(self.channel_get, + channel_only=True, usage="", min_args=1, + require_mode="o", help="Get a specified setting for the current " + "channel") def _set(self, settings, event, target): settings_dict = dict([(setting["setting"], setting