diff options
author | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-06-19 18:58:24 +0100 |
---|---|---|
committer | Sean B. Palmer <http://inamidst.com/sbp/> | 2008-06-19 18:58:24 +0100 |
commit | bf20b46f7473ec323cd38464fd8662c5fbc2c72a (patch) | |
tree | 4d6b8ac3f2277999dc60b3ec20cb3ac7687c0c61 /modules/admin.py | |
parent | 68f2036546c286bb864dbc2ade251041bf7e6be9 (diff) | |
download | bot-bf20b46f7473ec323cd38464fd8662c5fbc2c72a.tar.gz bot-bf20b46f7473ec323cd38464fd8662c5fbc2c72a.tar.bz2 bot-bf20b46f7473ec323cd38464fd8662c5fbc2c72a.zip |
Stop calc from flooding, and can now join channels with a key.
Diffstat (limited to 'modules/admin.py')
-rwxr-xr-x | modules/admin.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/admin.py b/modules/admin.py index e1dd908..3c3356f 100755 --- a/modules/admin.py +++ b/modules/admin.py @@ -12,10 +12,13 @@ def join(phenny, input): # Can only be done in privmsg by an admin if input.sender.startswith('#'): return if input.admin: - phenny.write(['JOIN'], input.group(2)) -join.commands = ['join'] + channel, key = input.group(1), input.group(2) + if not key: + phenny.write(['JOIN'], channel) + else: phenny.write(['JOIN', channel, key]) +join.rule = r'\.join (#\S+)(?: *(\S+))?' join.priority = 'low' -join.example = '.join #example' +join.example = '.join #example or .join #example key' def part(phenny, input): """Part the specified channel. This is an admin-only command.""" |