From 9b9f7bf0c44f407386bbb7c7a52800e8ccfddd29 Mon Sep 17 00:00:00 2001 From: ReaperOfVeriod Date: Mon, 4 Aug 2025 11:03:18 +0200 Subject: [PATCH] notifi role embed and button --- commands/utility/createnotifiembed.js | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 commands/utility/createnotifiembed.js diff --git a/commands/utility/createnotifiembed.js b/commands/utility/createnotifiembed.js new file mode 100644 index 0000000..b20d3a8 --- /dev/null +++ b/commands/utility/createnotifiembed.js @@ -0,0 +1,29 @@ +const { ActionRowBuilder, ButtonBuilder, ButtonStyle, SlashCommandBuilder, MessageFlags, PermissionFlagsBits, EmbedBuilder } = require('discord.js'); + +const rulesEmbed = new EmbedBuilder() + .setColor(0x0099FF) + .setTitle('Notifications.') + .setDescription('Would you like to be notified when i go live?') + .setThumbnail('https://i.imgur.com/3AlTfNL.png'); + +module.exports = { + cooldown: 30, + data: new SlashCommandBuilder() + .setName('createnotifiembed') + .setDescription('sends a embed with the notification embed') + .setDefaultMemberPermissions(0), + async execute(interaction) { + + const acceptNotifications = new ButtonBuilder() + .setCustomId('acceptnotifications') + .setLabel('I want notifications!') + .setStyle(ButtonStyle.Primary); + + const row = new ActionRowBuilder().addComponents(acceptNotifications); + + await interaction.reply({ + embeds: [rulesEmbed], + components: [row], + }); + }, +}; \ No newline at end of file