fix message flags for ephemeral
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { SlashCommandBuilder, MessageFlags } = require('discord.js');
|
||||
const torn = require('../../torn.js');
|
||||
const config = require('../../config.json');
|
||||
const state = require('../../state.json');
|
||||
@@ -16,17 +16,17 @@ module.exports = {
|
||||
const task = interaction.client.tasks[taskName];
|
||||
|
||||
if (!task) {
|
||||
await interaction.reply({ content: `Task "${taskName}" not found.`, ephemeral: true });
|
||||
await interaction.reply({ content: `Task "${taskName}" not found.`, flags: MessageFlags.Ephemeral });
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await interaction.reply({ content: `Executing task "${taskName}"...`, ephemeral: true });
|
||||
await interaction.reply({ content: `Executing task "${taskName}"...`, flags: MessageFlags.Ephemeral });
|
||||
await task(interaction.client, torn, config, state);
|
||||
await interaction.followUp({ content: `Task "${taskName}" executed successfully.`, ephemeral: true });
|
||||
await interaction.followUp({ content: `Task "${taskName}" executed successfully.`, flags: MessageFlags.Ephemeral });
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
await interaction.followUp({ content: `There was an error while executing task "${taskName}"!`, ephemeral: true });
|
||||
await interaction.followUp({ content: `There was an error while executing task "${taskName}"!`, flags: MessageFlags.Ephemeral });
|
||||
}
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user