tweak to history, bugfix to sending reply to dms

This commit is contained in:
Erik 2023-12-13 22:50:55 +02:00
parent 18fb92c3a0
commit f08879a19d
4 changed files with 26 additions and 13 deletions

View File

@ -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",

View File

@ -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)

View File

@ -259,10 +259,10 @@ class InvokerWrapper<InGuild extends boolean = boolean, HasCommand extends boole
if (options.dm)
{
this.#pending = await this.author.send(options);
await this.#target.reply({
content: ':thumbsup:',
ephemeral: true
});
if (this.deferred && !this.replied)
await this.#target.editReply({ content: ':thumbsup:' });
else
await this.#target.reply({ content: ':thumbsup:' });
return this.#pending;
}

View File

@ -339,7 +339,7 @@ switch({old}) {
}
[COMMAND_HISTORY_SUCCESS]
Fetched the {type} moderation cases {targets}.
Fetched the {type} moderation cases {targets}
[COMMAND_HISTORY_FAILTOOLONG]
Failed to display cases in one embed, try a smaller page size.