Update ban loop in bans list

This commit is contained in:
Zeva Rose 2021-07-03 17:27:42 -06:00
parent 95c7eca14c
commit bb85958d75

View file

@ -292,7 +292,9 @@ class AdminCog(commands.Cog):
active = bool(active)
ctx.defer()
types = [0, "perm", "temp", "soft"]
search = {"guild": ctx.guild.id, "active": active}
search = {"guild": ctx.guild.id}
if active:
search["active"] = True
if type > 0:
search["type"] = types[type]
bans = self.db.jarvis.bans.find(search).sort(
@ -310,7 +312,8 @@ class AdminCog(commands.Cog):
ban["user"],
ban["reason"],
)
async for ban in ctx.guild.bans():
bans = await ctx.guild.bans()
for ban in bans:
if ban.user.id not in db_bans:
message += "[unknown] {0} ({1}): {2}".format(
ban.user.name, ban.user.id, ban.reason