From b27397c040e510f84810e6b07d2b7b8c22e28ff0 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 14 Dec 2023 17:05:21 -0500 Subject: [PATCH] fix(moderation): make inline default to a pagesize of 6 --- moderation/moderation.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 5b9c06f..7f57dc9 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -822,7 +822,7 @@ class Moderation(commands.Cog): await self.log(interaction, moderation_id) @app_commands.command(name="history") - async def history(self, interaction: discord.Interaction, target: discord.User = None, moderator: discord.User = None, pagesize: app_commands.Range[int, 1, 25] = 5, page: int = 1, ephemeral: bool = False, inline: bool = False, export: bool = False): + async def history(self, interaction: discord.Interaction, target: discord.User = None, moderator: discord.User = None, pagesize: app_commands.Range[int, 1, 25] = None, page: int = 1, ephemeral: bool = False, inline: bool = False, export: bool = False): """List previous infractions. Parameters @@ -851,6 +851,12 @@ class Moderation(commands.Cog): database = await self.connect() cursor = database.cursor() + if pagesize is None: + if inline is True: + pagesize = 6 + else: + pagesize = 5 + if target: query = """SELECT * FROM moderation_%s