feat: return-based interaction reply edits

This commit is contained in:
TresAbhi committed 2023-06-16 02:01:06 +00:00
1 parent fbcd9e82e3
commit 4d9dc067af
19 files changed
+249 -306

No files matched your search

+17 -23
View File
@@ -1,7 +1,7 @@
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { SlashCommandBuilder } from 'discord.js';
import discord from '../../discord.json' assert { type: 'json' };
import { ACCENT_COLOR } from '../constants/colors.js';
import cmdName from '../core/interaction/cmdName.js';
import infoEmbed from '../core/interaction/infoEmbed.js';
import {
CommandRegistry,
guildCommands,
@@ -18,26 +18,20 @@ export default {
.setName(cmdName('help'))
.setDescription('All the help you need about the bot'),
async execute(interaction) {
await interaction.editReply({
embeds: [
new EmbedBuilder()
.setTitle(`${client.user?.username} help`)
.setColor(ACCENT_COLOR)
.setDescription(
`**About**\n${
client.user?.username
} automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/tresabhi/blitzkrieg\nDiscord server: https://discord.gg/nDt7AjGJQH\nSkilled server: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId ===
discord.sklld_guild_id
? [...guildCommands, ...publicCommands]
: publicCommands
)
.map((command) => `**/${command.name}**: ${command.description}`)
.join(
'\n',
)}\n\n*I am a new bot; I may make mistakes and go offline unexpectedly from time to time.*`,
),
],
});
execute(interaction) {
return infoEmbed(
`${client.user?.username} help`,
`**About**\n${
client.user?.username
} automates many mundane tasks and provide statistics in numerous flexible ways.\n\nMade by TresAbhi from the Skilled [SKLLD] clan.\nGitHub: https://github.com/tresabhi/blitzkrieg\nDiscord server: https://discord.gg/nDt7AjGJQH\nSkilled server: https://discord.gg/ZPvcEG7DS8\n\n**Commands**\n${(interaction.guildId ===
discord.sklld_guild_id
? [...guildCommands, ...publicCommands]
: publicCommands
)
.map((command) => `**/${command.name}**: ${command.description}`)
.join(
'\n',
)}\n\n*I am a new bot; I may make mistakes and go offline unexpectedly from time to time.*`,
);
},
} satisfies CommandRegistry;