fix(moderation): make inline default to a pagesize of 6
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 53s

This commit is contained in:
Seaswimmer 2023-12-14 17:05:21 -05:00
parent 47d359718c
commit b27397c040
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -822,7 +822,7 @@ class Moderation(commands.Cog):
await self.log(interaction, moderation_id) await self.log(interaction, moderation_id)
@app_commands.command(name="history") @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. """List previous infractions.
Parameters Parameters
@ -851,6 +851,12 @@ class Moderation(commands.Cog):
database = await self.connect() database = await self.connect()
cursor = database.cursor() cursor = database.cursor()
if pagesize is None:
if inline is True:
pagesize = 6
else:
pagesize = 5
if target: if target:
query = """SELECT * query = """SELECT *
FROM moderation_%s FROM moderation_%s