aboutsummaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
authorGravatar jesopo2019-07-01 13:51:13 +0100
committerGravatar jesopo2019-07-01 13:51:13 +0100
commitfda9869690d5bda459bbb272ea6b91a00e2c0639 (patch)
treee3e46eae71c157873752cf92c6d0b61959c41c73 /modules/commands
parentMerge pull request #77 from Jan69/master (diff)
signature
Add check.command.is-channel handler in commands module
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py
index 48211162..e466248a 100644
--- a/modules/commands/__init__.py
+++ b/modules/commands/__init__.py
@@ -425,3 +425,10 @@ class Module(ModuleManager.BaseModule):
return utils.consts.PERMISSION_FORCE_SUCCESS
else:
return "You do not have permission to do this"
+
+ @utils.hook("check.command.is-channel")
+ def check_command_self(self, event):
+ if event["is_channel"]:
+ return utils.consts.PERMISSION_FORCE_SUCCESS
+ else:
+ return "This command can only be used in-channel"