diff options
| author | 2018-09-09 09:26:56 +0100 | |
|---|---|---|
| committer | 2018-09-09 13:34:25 +0100 | |
| commit | 561dcdf799a54d4c9c5aa58b7b58452ae3ad1a56 (patch) | |
| tree | f0e78ce6231c9602acbfa773ace10950da81c9b7 /modules | |
| parent | i dun fixed it! (diff) | |
| signature | ||
Switch set.py to use delimited events
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/set.py | 33 |
1 files 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="<setting> <value>") - events.on("received").on("command").on("get").hook( - self.get, help="Get a specified user setting", - usage="<setting>", min_args=1) + events.on("received.command.set").hook(self.set, + usage="<setting> <value>", help="Set a specified user setting") + events.on("received.command.get").hook(self.get, min_args=1, + usage="<setting>", 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="<setting> <value>", 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="<setting> <value>", 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="<setting>", min_args=1, require_mode="o") + events.on("received.command.channelset").hook(self.channel_set, + channel_only=True, usage="<setting> <value>", 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="<setting> <value>", + permission="channelsetoverride", + help="Set a specified setting for the current channel") + events.on("received.command.channelget").hook(self.channel_get, + channel_only=True, usage="<setting>", 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 |
