Sfoglia il codice sorgente

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

tags/v1.8.0
Roxie Gibson 6 anni fa
parent
commit
2800bf4a2f
1 ha cambiato i file con 2 aggiunte e 4 eliminazioni
  1. +2
    -4
      roxbot/cogs/admin.py

+ 2
- 4
roxbot/cogs/admin.py Vedi 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…
Annulla
Salva