const {SlashCommandBuilder, EmbedBuilder, ButtonBuilder, ActionRowBuilder, ButtonStyle} = require('discord.js'); module.exports = { data: new SlashCommandBuilder() .setName('announcement') .setDescription('Announce something to the server') .addStringOption(option => option.setName('title').setDescription('The title of the announcement').setRequired(true)) .addStringOption(option => option.setName('description').setDescription('The description of the announcement').setRequired(true)), async execute(interaction) { const title = interaction.options.getString('title'); const description = interaction.options.getString('description'); const embed = new EmbedBuilder() .setTitle(title) .setDescription(description) .setColor('Random') .setTimestamp() const button = new ButtonBuilder() .setCustomId('announcement') .setLabel('Announcement') .setStyle(ButtonStyle.Primary) const actionRow = new ActionRowBuilder() .addComponents(button) await interaction.reply({embeds: [embed], components: [actionRow], ephemeral: true}); } };