aboutsummaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-14 12:09:42 +0100
committerGravatar jesopo2019-06-14 12:09:42 +0100
commitf614d1fc1480724b2d5f2cb409ad8a1962173b74 (patch)
tree3123b15da131a473532c063914e807edfca34c96 /modules/commands
parentAdd a way to __or__ `utils.Check`s, as a "if one of these passes" thing (diff)
signature
add `self` check.command, change !config to use new yields
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py
index 3b4dc74e..69b7201c 100644
--- a/modules/commands/__init__.py
+++ b/modules/commands/__init__.py
@@ -604,3 +604,11 @@ class Module(ModuleManager.BaseModule):
del aliases[alias]
self._set_aliases(event["server"], aliases)
event["stdout"].write("Removed '%s' alias" % alias)
+
+ @utils.hook("check.command.self")
+ def check_command_self(self, event):
+ if event["server"].irc_lower(event["request_args"][0]
+ ) == event["user"].name:
+ return utils.consts.PERMISSION_FORCE_SUCCESS
+ else:
+ return "You do not have permission to do this"