mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 04:08:56 -05:00
fixed variable name in ban
This commit is contained in:
parent
43413a4e26
commit
96e04bdf98
@ -63,17 +63,17 @@ class Mod:
|
||||
|
||||
@commands.command(no_pm=True, pass_context=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.
|
||||
|
||||
Minimum 0 days, maximum 7. Defaults to 0."""
|
||||
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.")
|
||||
return
|
||||
try:
|
||||
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.")
|
||||
except discord.errors.Forbidden:
|
||||
await self.bot.say("I'm not allowed to do that.")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user