diff options
| author | 2018-09-30 17:29:09 +0100 | |
|---|---|---|
| committer | 2018-09-30 17:29:09 +0100 | |
| commit | 10ef985a8a849a6bbfa8cbb63c2548e42ffb3957 (patch) | |
| tree | 4da29ff0462ca69820d81aa95afb4b261ab3213c /modules/todo.py | |
| parent | received.command takes a final [command] part (diff) | |
| signature | ||
Switch to using docstring for usage, permission and require_mode
Diffstat (limited to 'modules/todo.py')
| -rw-r--r-- | modules/todo.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/modules/todo.py b/modules/todo.py index 957accee..5d2f0eda 100644 --- a/modules/todo.py +++ b/modules/todo.py @@ -1,10 +1,11 @@ from src import ModuleManager, Utils class Module(ModuleManager.BaseModule): - @Utils.hook("received.command.todo", usage="[item number]") + @Utils.hook("received.command.todo") def todo(self, event): """ - Find out what's in your todo list + :help: Find out what's in your todo list + :usage: [item number] """ todo = event["user"].get_setting("todo", []) if event["args"]: @@ -20,10 +21,11 @@ class Module(ModuleManager.BaseModule): todo_count = len(todo) event["stdout"].write("There are %d items in your todo" % todo_count) - @Utils.hook("received.command.todoadd", min_args=1, usage="<description>") + @Utils.hook("received.command.todoadd", min_args=1) def todo_add(self, event): """ - Add something to your todo list + :help: Add something to your todo list + :usage: <description> """ arg_lower = event["args"].lower() todo = event["user"].get_setting("todo", []) @@ -36,10 +38,11 @@ class Module(ModuleManager.BaseModule): event["user"].set_setting("todo", todo) event["stdout"].write("Saved") - @Utils.hook("received.command.tododel", min_args=1, usage="<item number>") + @Utils.hook("received.command.tododel", min_args=1) def todo_del(self, event): """ - Remove something from your todo list + :help: Remove something from your todo list + :usage: <item number> """ todo = event["user"].get_setting("todo", []) if event["args_split"][0].isdigit() and int(event["args_split"][0]) > 0: |
