Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ChOp] Allow !op/!deop #channel nick
  • Loading branch information
sfan5 committed May 11, 2013
1 parent 3708200 commit 128c8fa
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions chop.py
Expand Up @@ -163,7 +163,17 @@ def op(phenny, input):
arg = input.group(2)
if not arg: return phenny.write(['MODE', input.sender, '+o', input.nick], "")
arg = arg.split(" ")
for va in arg:
skip_next = False
for i in xrange(0, len(arg)):
if skip_next:
skip_next = False
continue
va = arg[i]
if va.startswith('#'):
if i+2 > len(arg): return phenny.reply("Too few arguments")
phenny.write(['MODE', va, '+o', arg[i+1], "")
skip_next = True
continue
phenny.write(['MODE', input.sender, '+o', va], "")

op.commands = ['op']
Expand All @@ -175,7 +185,17 @@ def deop(phenny, input):
arg = input.group(2)
if not arg: return phenny.write(['MODE', input.sender, '-o', input.nick], "")
arg = arg.split(" ")
for va in arg:
skip_next = False
for i in xrange(0, len(arg)):
if skip_next:
skip_next = False
continue
va = arg[i]
if va.startswith('#'):
if i+2 > len(arg): return phenny.reply("Too few arguments")
phenny.write(['MODE', va, '-o', arg[i+1], "")
skip_next = True
continue
phenny.write(['MODE', input.sender, '-o', va], "")

deop.commands = ['deop']
Expand Down

0 comments on commit 128c8fa

Please sign in to comment.