Browse Source

changed unban to do a single ban lookup through the new function in discord.py

tags/v1.8.0
Roxie Gibson 6 years ago
parent
commit
2800bf4a2f
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      roxbot/cogs/admin.py

+ 2
- 4
roxbot/cogs/admin.py View File

@@ -277,10 +277,8 @@ class Admin:
@bot.command()
async def unban(self, ctx, member: roxbot.converters.UserConverter, *, reason=""):
"""Unbans user with given ID. Allows you to give a reason."""
mem = None
for ban in await ctx.guild.bans():
if ban.user.id == member.id:
mem = ban.user
ban = await ctx.guild.get_ban(member)
mem = ban.user
if mem is None:
raise bot.CommandError("User not found in bans.")
try:

Loading…
Cancel
Save