From 890d71fbe12d8b655c52ba659a4262ea84597ce1 Mon Sep 17 00:00:00 2001 From: Taken Date: Sun, 6 Aug 2023 09:34:34 +0200 Subject: [PATCH] Added verify message btn --- commands/config.js | 39 ++++++++++++++++++++++++++++++++++++++- events/buttons/verify.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 events/buttons/verify.js diff --git a/commands/config.js b/commands/config.js index f9f904f..a9d9edf 100644 --- a/commands/config.js +++ b/commands/config.js @@ -28,6 +28,15 @@ module.exports = { .setName("channel") .setDescription("The channel to send the application to.") .setRequired(true))) + .addSubcommand((subcommand) => + subcommand + .setName("sendverfiymessage") + .setDescription("Send the verfiy message to a channel.") + .addChannelOption((option) => + option + .setName("channel") + .setDescription("The channel to send the verfiy message to.") + .setRequired(true))) .addSubcommand((subcommand) => subcommand .setName("sendinactivityapplication") @@ -155,8 +164,36 @@ module.exports = { await interaction.reply({ content: "Message sent", ephemeral: true }); } + if (subcommand === "sendverfiymessage") { + const channel = interaction.options.getChannel("channel"); + + await channel.send({ + embeds: [{ + title: "Verification", + description: "You can verify by clicking the button below.", + color: embedColor, + footer: { + text: interaction.guild.name + " | Developed by @Taken#0002", + iconURL: interaction.guild.iconURL({ dynamic: true }) + }, + thumbnail: { + url: interaction.guild.iconURL({ dynamic: true }) + } + }], + components: [ + new ActionRowBuilder() + .addComponents(new ButtonBuilder() + .setCustomId("verifybutton") + .setLabel("Verify") + .setStyle(ButtonStyle.Primary) + .setEmoji({ name: "✅" })) + ] + }); + + } + if (subcommand !== "sendguildinfo" || "sendrequirements" || "sendrules-info") { await interaction.reply({ content: "In development.", ephemeral: true }); } } -}; \ No newline at end of file +}; diff --git a/events/buttons/verify.js b/events/buttons/verify.js new file mode 100644 index 0000000..2ab60a8 --- /dev/null +++ b/events/buttons/verify.js @@ -0,0 +1,28 @@ +const { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } = require('discord.js') +const { color } = require('../config/options.json') + +module.exports = { + name: 'verify', + description: 'Configure the bot.', + type: 'btn', + + async execute(interaction) { + + const modal = new ModalBuilder() + .setTitle("Verification") + .setCustomId("verifybox") + .setComponents( + new ActionRowBuilder().setComponents( + new TextInputBuilder() + .setLabel("IGN") + .setCustomId("verifyfield") + .setStyle(TextInputStyle.Short) + .setPlaceholder("Enter your ign.") + .setRequired(true) + .setMinLength(3) + .setMaxLength(16) + ) + ) + await interaction.showModal(modal) + } +}