Command De Anuncio Public

JavaScript Actualizado Aug 28, 2025

Archivos de Código

Ads

23 líneas
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('announce')
        .setDescription('Envía un anuncio en el canal seleccionado')
        .addChannelOption(option => option.setName('canal').setDescription('Canal donde enviar el anuncio').setRequired(true))
        .addStringOption(option => option.setName('mensaje').setDescription('Mensaje del anuncio').setRequired(true)),
    async execute(interaction) {
        const canal = interaction.options.getChannel('canal');
        const mensaje = interaction.options.getString('mensaje');

        const embed = new EmbedBuilder()
            .setTitle('📢 Anuncio')
            .setDescription(mensaje)
            .setColor('Purple')
            .setFooter({ text: `Anunciado por ${interaction.user.tag}`, iconURL: interaction.user.displayAvatarURL() })
            .setTimestamp();

        canal.send({ embeds: [embed] });
        interaction.reply({ content: `✅ Anuncio enviado en ${canal}`, ephemeral: true });
    },
};

Comentarios (1)

edgajuman

Good