fix !fallow message

This commit is contained in:
jacob1 2014-11-02 16:27:41 -05:00
parent 815b38a7e9
commit 54af1fbd2d

View File

@ -5169,15 +5169,12 @@ def deny(cli, nick, chan, rest, allow):
msg = "\u0002{0}\u0002 ({1}) is not {2} commands.".format(data[0], cloak, "allowed any special" if allow else "denied any") msg = "\u0002{0}\u0002 ({1}) is not {2} commands.".format(data[0], cloak, "allowed any special" if allow else "denied any")
else: else:
commands = data[1:] commands = data[1:]
#Error here if it's not a real command variable[cloak] = ()
for command in commands:
if len(commands): if command.startswith(botconfig.CMD_CHAR):
variable[cloak] = () command = command[len(botconfig.CMD_CHAR):]
for command in commands: if (command in COMMANDS or command in PM_COMMANDS) and command not in ["fdeny", "fallow", "exec", "eval"]:
if command.startswith(botconfig.CMD_CHAR): variable[cloak] += (command,)
command = command[len(botconfig.CMD_CHAR):]
if (command in COMMANDS or command in PM_COMMANDS) and command not in ["fdeny", "fallow", "exec", "eval"]:
variable[cloak] += (command,)
if len(variable[cloak]): if len(variable[cloak]):
msg = "\u0002{0}\u0002 ({1}) is now {2} the following commands: {3}{4}.".format( msg = "\u0002{0}\u0002 ({1}) is now {2} the following commands: {3}{4}.".format(
data[0], cloak, "allowed" if allow else "denied", botconfig.CMD_CHAR, ", {0}".format(botconfig.CMD_CHAR).join(variable[cloak])) data[0], cloak, "allowed" if allow else "denied", botconfig.CMD_CHAR, ", {0}".format(botconfig.CMD_CHAR).join(variable[cloak]))
@ -5185,7 +5182,7 @@ def deny(cli, nick, chan, rest, allow):
del variable[cloak] del variable[cloak]
msg = "\u0002{0}\u0002 ({1}) is no longer {2} commands.".format(data[0], cloak, "allowed any special" if allow else "denied any") msg = "\u0002{0}\u0002 ({1}) is no longer {2} commands.".format(data[0], cloak, "allowed any special" if allow else "denied any")
elif variable: elif variable:
msg = "denied: {0}".format(", ".join( msg = "{0}: {1}".format("allowed" if allow else "denied", ", ".join(
"\u0002{0}\u0002 ({1}{2})".format(cloak, botconfig.CMD_CHAR, ", {0}".format(botconfig.CMD_CHAR).join(denied)) "\u0002{0}\u0002 ({1}{2})".format(cloak, botconfig.CMD_CHAR, ", {0}".format(botconfig.CMD_CHAR).join(denied))
for cloak, denied in variable.items())) for cloak, denied in variable.items()))
else: else: