mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-10 10:43:06 +00:00
chore: improve safety of commands
This commit is contained in:
parent
83bbf7b098
commit
7c2a99daf5
28 changed files with 329 additions and 235 deletions
|
@ -16,6 +16,10 @@ const command: Command = {
|
|||
.setName('members')
|
||||
.setDescription('Lists all non-bot members of the server'),
|
||||
execute: async (interaction) => {
|
||||
if (!interaction.isChatInputCommand() || !interaction.guild) return;
|
||||
|
||||
await interaction.deferReply();
|
||||
|
||||
let members = await getAllMembers();
|
||||
members = members.sort((a, b) =>
|
||||
(a.discordUsername ?? '').localeCompare(b.discordUsername ?? ''),
|
||||
|
@ -63,7 +67,7 @@ const command: Command = {
|
|||
const components =
|
||||
pages.length > 1 ? [getButtonActionRow(), getSelectMenuRow()] : [];
|
||||
|
||||
await interaction.reply({
|
||||
await interaction.editReply({
|
||||
embeds: [pages[currentPage]],
|
||||
components,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue