Fix caching error in /bans list, closes #68

This commit is contained in:
Zeva Rose 2021-07-24 21:04:52 -06:00
parent 53f4f2838d
commit 0650e033d8

View file

@ -342,7 +342,8 @@ class AdminCog(commands.Cog):
async def _bans_list(
self, ctx: SlashContext, type: int = 0, active: int = 1
):
exists = self.check_cache(ctx, type=type)
active = bool(active)
exists = self.check_cache(ctx, type=type, active=active)
if exists:
await ctx.defer(hidden=True)
await ctx.send(
@ -351,7 +352,6 @@ class AdminCog(commands.Cog):
hidden=True,
)
return
active = bool(active)
types = [0, "perm", "temp", "soft"]
search = {"guild": ctx.guild.id}
if active:
@ -435,6 +435,7 @@ class AdminCog(commands.Cog):
"timeout": datetime.utcnow() + timedelta(minutes=5),
"command": ctx.subcommand_name,
"type": type,
"active": active,
"paginator": paginator,
}