Performance testing
diff --git a/src/commands/mod/_meta.ts b/src/commands/mod/_meta.ts
index 987a1c1..af8006c 100644
--- a/src/commands/mod/_meta.ts
+++ b/src/commands/mod/_meta.ts
@@ -3,6 +3,6 @@
const name = "mod";
const description = "Perform moderator actions";
-const subcommand = await command(name, description, `mod`)
+const subcommand = await command(name, description, `mod`);
export { name, description, subcommand as command };
diff --git a/src/commands/mod/ban.ts b/src/commands/mod/ban.ts
index 7346bcc..ba60d1e 100644
--- a/src/commands/mod/ban.ts
+++ b/src/commands/mod/ban.ts
@@ -74,6 +74,7 @@
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
+ if (reason) { reason = reason.split("\n").map((line) => "> " + line).join("\n") }
const messageData: {
embeds: EmojiEmbed[];
components: ActionRowBuilder<ButtonBuilder>[];
@@ -83,7 +84,8 @@
.setEmoji("PUNISH.BAN.RED")
.setTitle("Banned")
.setDescription(
- `You have been banned in ${interaction.guild.name}` + (reason ? ` for:\n> ${reason}` : ".")
+ `You have been banned in ${interaction.guild.name}` +
+ (reason ? ` for:\n${reason}` : ".\n*No reason was provided.*")
)
.setStatus("Danger")
],
diff --git a/src/commands/mod/info.ts b/src/commands/mod/info.ts
index 6b5c81e..fac87a0 100644
--- a/src/commands/mod/info.ts
+++ b/src/commands/mod/info.ts
@@ -23,6 +23,7 @@
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("info")
+ // .setNameLocalizations({"ru": "about", "zh-CN": "history", "zh-TW": "notes", "pt-BR": "flags"})
.setDescription("Shows moderator information about a user")
.addUserOption((option) =>
option.setName("user").setDescription("The user to get information about").setRequired(true)
diff --git a/src/commands/mod/kick.ts b/src/commands/mod/kick.ts
index dd71892..88b6e14 100644
--- a/src/commands/mod/kick.ts
+++ b/src/commands/mod/kick.ts
@@ -75,6 +75,7 @@
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
+ if (reason) { reason = reason.split("\n").map((line) => "> " + line).join("\n") }
const messageData: {
embeds: EmojiEmbed[];
components: ActionRowBuilder<ButtonBuilder>[];
@@ -85,7 +86,7 @@
.setTitle("Kicked")
.setDescription(
`You have been kicked from ${interaction.guild.name}` +
- (reason ? ` for:\n> ${reason}` : ".\n*No reason was provided.*")
+ (reason ? ` for:\n${reason}` : ".\n*No reason was provided.*")
)
.setStatus("Danger")
],
diff --git a/src/commands/mod/mute.ts b/src/commands/mod/mute.ts
index 05a9ec2..d68272b 100644
--- a/src/commands/mod/mute.ts
+++ b/src/commands/mod/mute.ts
@@ -13,6 +13,7 @@
const command = (builder: SlashCommandSubcommandBuilder) =>
builder
.setName("mute")
+ // .setNameLocalizations({"ru": "silence"})
.setDescription("Mutes a member, stopping them from talking in the server")
.addUserOption((option) => option.setName("user").setDescription("The user to mute").setRequired(true))
.addIntegerOption((option) =>
@@ -234,6 +235,7 @@
let dmMessage;
try {
if (notify) {
+ if (reason) { reason = reason.split("\n").map((line) => "> " + line).join("\n") }
const messageData: {
embeds: EmojiEmbed[];
components: ActionRowBuilder<ButtonBuilder>[];
@@ -244,7 +246,7 @@
.setTitle("Muted")
.setDescription(
`You have been muted in ${interaction.guild.name}` +
- (reason ? ` for:\n> ${reason}` : ".\n*No reason was provided*") + "\n\n" +
+ (reason ? ` for:\n${reason}` : ".\n*No reason was provided*") + "\n\n" +
`You will be unmuted at: <t:${Math.round(new Date().getTime() / 1000) + muteTime}:D> at ` +
`<t:${Math.round(new Date().getTime() / 1000) + muteTime}:T> (<t:${Math.round(new Date().getTime() / 1000) + muteTime
}:R>)` + "\n\n" +
diff --git a/src/commands/mod/nick.ts b/src/commands/mod/nick.ts
index 0975375..81935a2 100644
--- a/src/commands/mod/nick.ts
+++ b/src/commands/mod/nick.ts
@@ -1,4 +1,4 @@
-import { CommandInteraction, GuildMember } from "discord.js";
+import type { CommandInteraction, GuildMember } from "discord.js";
import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
import confirmationMessage from "../../utils/confirmationMessage.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
@@ -8,6 +8,7 @@
const command = (builder: SlashCommandSubcommandBuilder) => builder
.setName("nick")
+ // .setNameLocalizations({"ru": "name", "zh-CN": "nickname"})
.setDescription("Changes a users nickname")
.addUserOption((option) => option.setName("user").setDescription("The user to change").setRequired(true))
.addStringOption((option) =>
diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index 6087890..3020eb8 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -29,11 +29,7 @@
if (!interaction.guild) return;
const user = (interaction.options.getMember("user") as GuildMember | null);
const channel = interaction.channel as GuildChannel;
- if (
- !["GUILD_TEXT", "GUILD_NEWS", "GUILD_NEWS_THREAD", "GUILD_PUBLIC_THREAD", "GUILD_PRIVATE_THREAD"].includes(
- channel.type.toString()
- )
- ) {
+ if (channel.isTextBased()) {
return await interaction.reply({
embeds: [
new EmojiEmbed()
diff --git a/src/commands/mod/warn.ts b/src/commands/mod/warn.ts
index 390baa5..d920bb0 100644
--- a/src/commands/mod/warn.ts
+++ b/src/commands/mod/warn.ts
@@ -84,6 +84,7 @@
const config = await client.database.guilds.read(interaction.guild.id);
try {
if (notify) {
+ if (reason) { reason = reason.split("\n").map((line) => "> " + line).join("\n") }
const messageData: {
embeds: EmojiEmbed[];
components: ActionRowBuilder<ButtonBuilder>[];
@@ -94,7 +95,7 @@
.setTitle("Warned")
.setDescription(
`You have been warned in ${interaction.guild.name}` +
- (reason ? ` for:\n> ${reason}` : ".\n*No reason was provided*") +
+ (reason ? ` for:\n${reason}` : ".\n*No reason was provided*") +
"\n\n" +
(createAppealTicket
? `You can appeal this in the ticket created in <#${confirmation.components!["appeal"]!.response}>`