diff --git a/src/modules/core/set.command.ts b/src/modules/core/set.command.ts index 1044598..b176723 100644 --- a/src/modules/core/set.command.ts +++ b/src/modules/core/set.command.ts @@ -1,5 +1,7 @@ import { ActionRowBuilder, + ApplicationCommandOptionType, + ApplicationCommandType, ButtonBuilder, ButtonStyle, Colors, @@ -7,11 +9,6 @@ import { GuildMember, } from "discord.js"; import { Command } from "djs-slash-helper"; - -import { - ApplicationCommandOptionType, - ApplicationCommandType, -} from "discord.js"; import { DDUser, getOrCreateUserById } from "../../store/models/DDUser.js"; import { createStandardEmbed } from "../../util/embeds.js"; import { mentionIfPingable } from "../../util/users.js"; @@ -93,7 +90,7 @@ export const SetCommand: Command = { const reply = await interaction.reply({ embeds: [embed], components: [buttons], - fetchReply: true, + withResponse: false, }); const channel = interaction.channel; @@ -118,7 +115,7 @@ export const SetCommand: Command = { const event = await collector.next; if (event.customId === "cancel") { await event.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "**Cancelled**", }); } else if (event.customId === "confirm") { @@ -126,7 +123,7 @@ export const SetCommand: Command = { setter(user, value); await user.save(); await event.followUp({ - ephemeral: true, + flags: ["Ephemeral"], embeds: [ createStandardEmbed(target) .setTitle("Success") diff --git a/src/modules/faq/faq.command.ts b/src/modules/faq/faq.command.ts index 38d1f60..b39f8f9 100644 --- a/src/modules/faq/faq.command.ts +++ b/src/modules/faq/faq.command.ts @@ -2,6 +2,7 @@ import { Command, ExecutableSubcommand } from "djs-slash-helper"; import { ApplicationCommandOptionType, ApplicationCommandType, + GuildMember, PermissionFlagsBits, } from "discord.js"; import { FAQ } from "../../store/models/FAQ.js"; @@ -9,7 +10,6 @@ import { createFaqEmbed } from "./faq.util.js"; import createFaqModal from "./faq.modal.js"; import { moduleManager } from "../../index.js"; import { logger } from "../../logging.js"; -import { GuildMember } from "discord.js"; const choices: Array<{ name: string; value: string }> = []; @@ -45,7 +45,7 @@ const GetSubcommand: ExecutableSubcommand = { }); if (faq == null) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No FAQ found with this name", }); } @@ -69,14 +69,14 @@ const EditSubcommand: ExecutableSubcommand = { const member = interaction.member as GuildMember; if (!member.permissions.has(PermissionFlagsBits.ManageMessages)) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No permission", }); } const name = interaction.options.get("name")?.value as string | null; if (name == null) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No FAQ name provided", }); } @@ -97,7 +97,7 @@ const EditSubcommand: ExecutableSubcommand = { author: BigInt(interaction.user.id), }); await response.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: `FAQ named ${name} created`, }); @@ -123,14 +123,14 @@ const DeleteSubcommand: ExecutableSubcommand = { const member = interaction.member as GuildMember; if (!member.permissions.has(PermissionFlagsBits.ManageMessages)) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No permission", }); } const name = interaction.options.get("name")?.value as string | null; if (name == null) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No FAQ name provided", }); } @@ -138,7 +138,7 @@ const DeleteSubcommand: ExecutableSubcommand = { const faq = await FAQ.findOne({ where: { name } }); if (faq == null) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No FAQ found with this name", }); } @@ -146,7 +146,7 @@ const DeleteSubcommand: ExecutableSubcommand = { await updateChoices(); await moduleManager.refreshCommands(); return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: `FAQ named ${name} deleted`, }); }, diff --git a/src/modules/information/informationMessage.command.ts b/src/modules/information/informationMessage.command.ts index 63d2aec..1a294d2 100644 --- a/src/modules/information/informationMessage.command.ts +++ b/src/modules/information/informationMessage.command.ts @@ -26,7 +26,7 @@ export const InformationMessageCommand: Command async handle(interaction) { if (!interaction.targetMessage.editable) { await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "I can't edit that message.", }); return; @@ -34,7 +34,7 @@ export const InformationMessageCommand: Command if (config.informationMessage == null) { await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "There is no information message configured.", }); return; @@ -63,7 +63,7 @@ export const InformationMessageCommand: Command )}`, ); await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "Information message set.", }); }, diff --git a/src/modules/information/informationMessage.listener.ts b/src/modules/information/informationMessage.listener.ts index e62a7fe..277b81f 100644 --- a/src/modules/information/informationMessage.listener.ts +++ b/src/modules/information/informationMessage.listener.ts @@ -39,7 +39,7 @@ export const InformationButtonListener: EventListener = { await interaction.followUp({ embeds: [embed], - ephemeral: true, + flags: ["Ephemeral"], }); return; } @@ -72,7 +72,7 @@ export const InformationButtonListener: EventListener = { (interaction.member as GuildMember) ?? undefined, ); await interaction.followUp({ - ephemeral: true, + flags: ["Ephemeral"], embeds: [embed], }); }, @@ -102,7 +102,7 @@ async function sendLearningResourcesPicker(interaction: ButtonInteraction) { components: [ new ActionRowBuilder().addComponents(selectMenu), ], - ephemeral: true, - fetchReply: true, + flags: ["Ephemeral"], + withResponse: false, }); } diff --git a/src/modules/learning/learning.command.ts b/src/modules/learning/learning.command.ts index b34b6cf..927ed70 100644 --- a/src/modules/learning/learning.command.ts +++ b/src/modules/learning/learning.command.ts @@ -130,7 +130,7 @@ const LearningUpdateSubcommand: ExecutableSubcommand = { const member = interaction.member as GuildMember; if (!member.permissions.has(PermissionFlagsBits.ManageMessages)) { return await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], content: "No permission", }); } @@ -165,7 +165,7 @@ const LearningListSubcommand: ExecutableSubcommand = { }); await interaction.reply({ - ephemeral: true, + flags: ["Ephemeral"], embeds: [embed], }); }, diff --git a/src/modules/roles/roleColour.command.ts b/src/modules/roles/roleColour.command.ts index c64bc46..cc593ca 100644 --- a/src/modules/roles/roleColour.command.ts +++ b/src/modules/roles/roleColour.command.ts @@ -75,7 +75,7 @@ const SetSubcommand: ExecutableSubcommand = { if (!colour.startsWith("#") || colour.length !== 7) { await interaction.reply({ content: "Not a valid colour", - ephemeral: true, + flags: ["Ephemeral"], }); return; } diff --git a/src/modules/xp/dailyReward.command.ts b/src/modules/xp/dailyReward.command.ts index 422c668..888e2ab 100644 --- a/src/modules/xp/dailyReward.command.ts +++ b/src/modules/xp/dailyReward.command.ts @@ -27,7 +27,7 @@ export const DailyRewardCommand: Command = { await interaction.deferReply(); if (dailiesInProgress.has(user.id)) { await interaction.followUp({ - ephemeral: true, + flags: ["Ephemeral"], content: "You are already claiming your daily reward!", }); return; @@ -45,7 +45,7 @@ export const DailyRewardCommand: Command = { } const nextClaimTime = getNextDailyTimeFrom(lastClaimTime); await interaction.followUp({ - ephemeral: true, + flags: ["Ephemeral"], content: `You can only claim your daily reward once every 24 hours. You can claim it again .`,