Update ban loop in bans list
This commit is contained in:
parent
95c7eca14c
commit
bb85958d75
1 changed files with 5 additions and 2 deletions
|
@ -292,7 +292,9 @@ class AdminCog(commands.Cog):
|
||||||
active = bool(active)
|
active = bool(active)
|
||||||
ctx.defer()
|
ctx.defer()
|
||||||
types = [0, "perm", "temp", "soft"]
|
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:
|
if type > 0:
|
||||||
search["type"] = types[type]
|
search["type"] = types[type]
|
||||||
bans = self.db.jarvis.bans.find(search).sort(
|
bans = self.db.jarvis.bans.find(search).sort(
|
||||||
|
@ -310,7 +312,8 @@ class AdminCog(commands.Cog):
|
||||||
ban["user"],
|
ban["user"],
|
||||||
ban["reason"],
|
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:
|
if ban.user.id not in db_bans:
|
||||||
message += "[unknown] {0} ({1}): {2}".format(
|
message += "[unknown] {0} ({1}): {2}".format(
|
||||||
ban.user.name, ban.user.id, ban.reason
|
ban.user.name, ban.user.id, ban.reason
|
||||||
|
|
Loading…
Add table
Reference in a new issue