From 14e2114acde8d9b09f83cbafbf7e32f0e7be4e74 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 21 Jul 2012 21:27:06 -0400 Subject: [PATCH] Made this a bit cleaner. Will revise all permissions code eventually when adopting the permissions.db system. --- earwigbot/commands/chanops.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/earwigbot/commands/chanops.py b/earwigbot/commands/chanops.py index 74aabad..d19c85f 100644 --- a/earwigbot/commands/chanops.py +++ b/earwigbot/commands/chanops.py @@ -33,7 +33,8 @@ class ChanOps(Command): msg = "Available commands are !voice, !devoice, !op, !deop, !join, and !part." self.reply(data, msg) return - if data.command[:2] == "de" and not data.args: + de_escalate = data.command[:2] in ["devoice", "deop"] + if de_escalate and (not data.args or data.args[0] == data.nick): target = data.nick elif data.host not in self.config.irc["permissions"]["admins"]: self.reply(data, "You must be a bot admin to use this command.")