]> jfr.im git - erebus.git/blobdiff - modules/chanops.py
urls - allow port in url
[erebus.git] / modules / chanops.py
index 7d8f40ceb840b1bd9fc4dcef50f4756075d386e1..ba88e58250c7c8935d52fde4f14d8bb0fca34931 100644 (file)
@@ -1,12 +1,13 @@
 # Erebus IRC bot - Author: Erebus Team
-# !EVAL and !EXEC commands
+# vim: fileencoding=utf-8
+# chanop commands
 # This file is released into the public domain; see http://unlicense.org/
 
 # module info
 modinfo = {
        'author': 'Erebus Team',
        'license': 'public domain',
-       'compatible': [1,2],
+       'compatible': [0],
        'depends': [],
        'softdeps': ['help'],
 }
@@ -22,9 +23,6 @@ import sys
 import ctlmod
 
 
-def module(name):
-       return lib.mod(name)
-
 def _kick(bot, user, chan, realtarget, *args):
        people = []
        if args[0].startswith("#"):
@@ -49,12 +47,17 @@ def kick(bot, user, chan, realtarget, *args):
        bot.msg(user, "Done. Kicked %d people." % (number))
 
 @lib.hook(None, clevel=lib.OP)
-@lib.help("<nick> [<reason>]", "kick all using the auth of <nick>")
+@lib.help("<nick|#auth> [<reason>]", "kick all using the auth of <nick>")
 @lib.argsGE(1)
 def kickall(bot, user, chan, realtarget, *args):
-       auth = bot.parent.user(args[0]).auth
+       target = args[0]
+       if target[0] == "#" and len(target) > 1:
+               auth = target[1:]
+       else:
+               auth = bot.parent.user(args[0]).auth
+
        if auth is not None:
-               number = _kick(bot, user, chan, realtarget, "#"+bot.parent.user(args[0]).auth, *args[1:])
+               number = _kick(bot, user, chan, realtarget, "#"+auth, *args[1:])
                bot.msg(user, "Done. Kicked %d people." % (number))
        else:
                bot.msg(user, "I don't know that person's auth.")