X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/fa93b93394adc45f4b3bd1694c960df127cfc4da..56580e4e6b07ddb00b7046e77dc007626ce130fb:/modules/chanops.py diff --git a/modules/chanops.py b/modules/chanops.py index 654c45c..ba88e58 100644 --- a/modules/chanops.py +++ b/modules/chanops.py @@ -1,4 +1,5 @@ # Erebus IRC bot - Author: Erebus Team +# vim: fileencoding=utf-8 # chanop commands # This file is released into the public domain; see http://unlicense.org/ @@ -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(" []", "kick all using the auth of ") +@lib.help(" []", "kick all using the auth of ") @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.")