task command work
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('tasks')
|
||||
.setDescription('List tasks'),
|
||||
.setDescription('Lists all available tasks.'),
|
||||
async execute(interaction) {
|
||||
await interaction.reply('todo');
|
||||
const taskNames = Object.keys(interaction.client.tasks);
|
||||
|
||||
if (taskNames.length === 0) {
|
||||
await interaction.reply({ content: 'No tasks found.', ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
||||
const embed = new EmbedBuilder()
|
||||
.setColor(0xBB99FF)
|
||||
.setTitle('Available Tasks')
|
||||
.setDescription(taskNames.map(name => `- ${name}`).join('\n'));
|
||||
|
||||
await interaction.reply({ embeds: [embed], ephemeral: true });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user