Update to modern Discord.js ephemeral message pattern
- Replace ephemeral: true with flags: [MessageFlags.Ephemeral] - Add MessageFlags import to Discord.js imports - Update all slash command error responses to use modern flag syntax - Maintains same functionality with Discord.js v14 best practices 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits, MessageFlags } = require('discord.js');
|
||||
const configManager = require('../../config/config');
|
||||
|
||||
module.exports = {
|
||||
@@ -92,7 +92,7 @@ module.exports = {
|
||||
if (!databaseService) {
|
||||
return interaction.reply({
|
||||
content: '❌ Database service not available.',
|
||||
ephemeral: true
|
||||
flags: [MessageFlags.Ephemeral]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { SlashCommandBuilder, MessageFlags } = require('discord.js');
|
||||
const sfxManager = require('../../services/sfxManager');
|
||||
const voiceService = require('../../services/voiceService');
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = {
|
||||
if (!allowedChannels.test(interaction.channel.name)) {
|
||||
return interaction.reply({
|
||||
content: 'Sound effects are not allowed in this channel!',
|
||||
ephemeral: true
|
||||
flags: [MessageFlags.Ephemeral]
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ module.exports = {
|
||||
if (!sfxManager.hasSFX(sfxName)) {
|
||||
return interaction.reply({
|
||||
content: 'This sound effect does not exist!',
|
||||
ephemeral: true
|
||||
flags: [MessageFlags.Ephemeral]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ module.exports = {
|
||||
if (!member.voice.channel) {
|
||||
return interaction.reply({
|
||||
content: 'You need to be in a voice channel to use this command!',
|
||||
ephemeral: true
|
||||
flags: [MessageFlags.Ephemeral]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ const {
|
||||
REST,
|
||||
Routes,
|
||||
ActivityType,
|
||||
MessageFlags,
|
||||
} = require("discord.js");
|
||||
const { generateDependencyReport } = require("@discordjs/voice");
|
||||
const intents = require("./config/intents");
|
||||
@@ -201,7 +202,7 @@ client.on(Events.InteractionCreate, async (interaction) => {
|
||||
await interaction
|
||||
.reply({
|
||||
content: "There was an error executing this command!",
|
||||
ephemeral: true,
|
||||
flags: [MessageFlags.Ephemeral],
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user