used set.py as an example for the new usage command.

This commit is contained in:
jesopo 2016-04-05 18:41:33 +01:00
parent e8875ef17d
commit efa8c91552
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3

View file

@ -10,10 +10,12 @@ class Module(object):
bot.events.on("postboot").on("configure").on("channelset" bot.events.on("postboot").on("configure").on("channelset"
).hook(self.postboot_channelset) ).hook(self.postboot_channelset)
bot.events.on("received").on("command").on("set").hook( bot.events.on("received").on("command").on("set").hook(
self.set, help="Set a specified user setting") self.set, help="Set a specified user setting",
usage="<setting> <value>")
bot.events.on("received").on("command").on("channelset" bot.events.on("received").on("command").on("channelset"
).hook(self.channel_set, channel_only=True, ).hook(self.channel_set, channel_only=True,
help="Set a specified setting for the current channel") help="Set a specified setting for the current channel",
usage="<setting> <value>")
def _postboot_set(self, settings, event): def _postboot_set(self, settings, event):
settings[event["setting"]] = {} settings[event["setting"]] = {}