task command work

This commit is contained in:
2025-11-11 13:34:35 -05:00
parent 898c8cd2e6
commit 1bb204883c
3 changed files with 41 additions and 8 deletions

View File

@@ -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 });
},
};