From 10ef985a8a849a6bbfa8cbb63c2548e42ffb3957 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 30 Sep 2018 17:29:09 +0100 Subject: Switch to using docstring for usage, permission and require_mode --- modules/auto_mode.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'modules/auto_mode.py') diff --git a/modules/auto_mode.py b/modules/auto_mode.py index d1851a58..ae233396 100644 --- a/modules/auto_mode.py +++ b/modules/auto_mode.py @@ -51,32 +51,36 @@ class Module(ModuleManager.BaseModule): event["stdout"].write("Removed automode %s from '%s'" % ( mode_name, target_user.nickname)) - @Utils.hook("received.command.addop", require_mode="o", min_args=1, - channel_only=True, usage="") + @Utils.hook("received.command.addop", min_args=1, channel_only=True) def add_op(self, event): """ - Add a user to the auto-mode list as an op + :help: Add a user to the auto-mode list as an op + :usage: + :require_mode: o """ self._add_mode(event, "o", "op") - @Utils.hook("received.command.removeop", require_mode="o", min_args=1, - channel_only=True, usage="") + @Utils.hook("received.command.removeop", min_args=1, channel_only=True) def remove_op(self, event): """ - Remove a user from the auto-mode list as an op + :help: Remove a user from the auto-mode list as an op + :usage: + :require_mode: o """ self._remove_mode(event, "o", "op") - @Utils.hook("received.command.addvoice", require_mode="o", min_args=1, - channel_only=True, usage="") + @Utils.hook("received.command.addvoice", min_args=1, channel_only=True) def add_voice(self, event): """ - Add a user to the auto-mode list as a voice + :help: Add a user to the auto-mode list as a voice + :usage: + :require_mode: o """ self._add_mode(event, "v", "voice") - @Utils.hook("received.command.removevoice", require_mode="o", min_args=1, - channel_only=True, usage="") + @Utils.hook("received.command.removevoice", min_args=1, channel_only=True) def remove_voice(self, event): """ - Remove a user from the auto-mode list as anvoice + :help: Remove a user from the auto-mode list as a voice + :usage: + :require_mode: o """ self._remove_mode(event, "v", "voice") -- cgit v1.3.1-10-gc9f91