aboutsummaryrefslogtreecommitdiff
path: root/src/core_modules/admin.py
diff options
context:
space:
mode:
authorGravatar jesopo2020-03-10 14:49:41 +0000
committerGravatar jesopo2020-03-10 14:49:41 +0000
commit5239d54fbe2a56711474a359a4c57b622e0b7e89 (patch)
tree2f5af7f49dfe4b4f4dd6b7687b6eaa7af63a479d /src/core_modules/admin.py
parentremove debug print (diff)
signature
fix !part, add !join
Diffstat (limited to 'src/core_modules/admin.py')
-rw-r--r--src/core_modules/admin.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core_modules/admin.py b/src/core_modules/admin.py
index f87927b1..5008952d 100644
--- a/src/core_modules/admin.py
+++ b/src/core_modules/admin.py
@@ -32,9 +32,17 @@ class Module(ModuleManager.BaseModule):
@utils.kwarg("permission", "part")
@utils.kwarg("require_mode", "high")
@utils.kwarg("require_access", "high,part")
- @utils.spec("!r~channel")
+ @utils.spec("!-privateonly !<channel>word")
+ @utils.spec("!-channelonly ?<channel>word")
def part(self, event):
- event["server"].send_part(event["spec"][0].name)
+ event["server"].send_part(event["spec"][0] or event["target"].name)
+
+ @utils.hook("received.command.join")
+ @utils.kwarg("help", "Join a given channel")
+ @utils.kwarg("permission", "join")
+ @utils.spec("!<channel>word")
+ def join(self, event):
+ event["server"].send_join(event["spec"][0])
def _id_from_alias(self, alias):
return self.bot.database.servers.get_by_alias(alias)