fixed variable name in ban

This commit is contained in:
Will Tekulve 2016-02-27 21:28:25 -05:00
parent 43413a4e26
commit 96e04bdf98

View File

@ -63,17 +63,17 @@ class Mod:
@commands.command(no_pm=True, pass_context=True) @commands.command(no_pm=True, pass_context=True)
@checks.admin_or_permissions(ban_members=True) @checks.admin_or_permissions(ban_members=True)
async def ban(self, ctx, user : discord.Member, purge_msg : int=0): async def ban(self, ctx, user : discord.Member, days : int=0):
"""Bans user and deletes last X days worth of messages. """Bans user and deletes last X days worth of messages.
Minimum 0 days, maximum 7. Defaults to 0.""" Minimum 0 days, maximum 7. Defaults to 0."""
author = ctx.message.author author = ctx.message.author
if purge_msg < 0 or purge_msg > 7: if days < 0 or days > 7:
await self.bot.say("Invalid days. Must be between 0 and 7.") await self.bot.say("Invalid days. Must be between 0 and 7.")
return return
try: try:
await self.bot.ban(user, days) await self.bot.ban(user, days)
logger.info("{}({}) banned {}({}), deleting {} days worth of messages".format(author.name, author.id, user.name, user.id, str(purge_msg))) logger.info("{}({}) banned {}({}), deleting {} days worth of messages".format(author.name, author.id, user.name, user.id, str(days)))
await self.bot.say("Done. It was about time.") await self.bot.say("Done. It was about time.")
except discord.errors.Forbidden: except discord.errors.Forbidden:
await self.bot.say("I'm not allowed to do that.") await self.bot.say("I'm not allowed to do that.")