From f08879a19d6f760cba5296d59a6fb9e8c72503d8 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 13 Dec 2023 22:50:55 +0200 Subject: [PATCH] tweak to history, bugfix to sending reply to dms --- .eslintrc.json | 15 +++++++++++---- .../components/commands/moderation/History.ts | 14 ++++++++++---- src/client/components/wrappers/InvokerWrapper.ts | 8 ++++---- .../en_gb/commands/en_gb_moderation.lang | 2 +- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 8ef5cdf..4eafd9e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -96,9 +96,13 @@ "id-blacklist": "warn", "id-match": "warn", "implicit-arrow-linebreak": "warn", - "indent": ["warn", 4, { - "SwitchCase": 1 - }], + "indent": [ + "warn", + 4, + { + "SwitchCase": 1 + } + ], "init-declarations": "warn", "quotes": [ "error", @@ -200,7 +204,10 @@ "no-restricted-modules": "warn", "no-restricted-properties": "warn", "no-restricted-syntax": "warn", - "no-return-assign": ["warn", "except-parens"], + "no-return-assign": [ + "warn", + "except-parens" + ], "no-return-await": "warn", "no-script-url": "warn", "no-self-compare": "warn", diff --git a/src/client/components/commands/moderation/History.ts b/src/client/components/commands/moderation/History.ts index 19cebf7..5c46fdd 100644 --- a/src/client/components/commands/moderation/History.ts +++ b/src/client/components/commands/moderation/History.ts @@ -10,7 +10,7 @@ import { APIEmbed, AttachmentBuilder, GuildChannel, User } from 'discord.js'; import { Filter } from 'mongodb'; const Constants = { - PageSize: 5, + PageSize: 10, MaxCharacters: 256, MaxCharactersVerbose: 128 // Displays more information in the field, decreases characters. }; @@ -56,8 +56,9 @@ class HistoryCommand extends SlashCommand description: 'Amount of infractions to list per page', type: CommandOptionType.INTEGER, flag: true, - maximum: 10, - minimum: 1 + maximum: 25, + minimum: 1, + defaultValue: 10 }, { name: 'page', description: 'Page to select', @@ -221,8 +222,13 @@ class HistoryCommand extends SlashCommand embed.fields!.push({ name: `__**${infraction.type} \`[case-${infraction.case}]\`** *(${moment(infraction.timestamp).fromNow()})*__`, - value: string + value: string, + inline: true }); + if (results.length <= 16 && i > 0 && i % 2 === 1) + embed.fields!.push({ + name: ZeroWidthChar, value: ZeroWidthChar, inline: true + }); } if (long) diff --git a/src/client/components/wrappers/InvokerWrapper.ts b/src/client/components/wrappers/InvokerWrapper.ts index 5e521c1..d7b15c4 100644 --- a/src/client/components/wrappers/InvokerWrapper.ts +++ b/src/client/components/wrappers/InvokerWrapper.ts @@ -259,10 +259,10 @@ class InvokerWrapper