From f16b53e4957e6108ff425483b0140cac17dc1fcb Mon Sep 17 00:00:00 2001 From: kieranrobson Date: Thu, 12 May 2022 00:01:18 +0100 Subject: [PATCH] Added discord modals --- commands/embeds/paidmember.js | 33 +++++++++++++++++++++++++++++++++ index.js | 5 ++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 commands/embeds/paidmember.js diff --git a/commands/embeds/paidmember.js b/commands/embeds/paidmember.js new file mode 100644 index 0000000..9ce054c --- /dev/null +++ b/commands/embeds/paidmember.js @@ -0,0 +1,33 @@ +const discord = require("discord.js"); +const { Modal } = require('discord-modals') // Modal class + +module.exports = { + name: "welcome", + aliases: [''], + /** + * + * @param {Client} client + * @param {Message} message + * @param {String[]} args + */ + run: async (client, message, args) => { + const embed = new discord.MessageEmbed() + .setColor('GREEN') + .setFooter(`Called By: ${message.author.tag}`) + .setTimestamp() + .setTitle("Paid Member!") + .setDescription(`Press the button below to get access to the paid member role.`) + .setThumbnail('https://i.imgur.com/ww6wKwJ.png') + + + const row = new discord.MessageActionRow() + .addComponents( + new discord.MessageButton() + .setURL('https://github.com/hullcss/conduct/') + .setEmoji('') + .setLabel('Code of Conduct') + .setStyle('LINK') + ) + message.channel.send({ embeds: [embed], components: [row] }) + }, +}; \ No newline at end of file diff --git a/index.js b/index.js index 67733f0..2032d36 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,6 @@ const config = require("./config.json"); const { Client, Collection } = require("discord.js"); - - - +const discordModals = require('discord-modals') const client = new Client({ intents: 32767, }); @@ -11,6 +9,7 @@ module.exports = client; // Global Variables client.commands = new Collection(); client.slashCommands = new Collection(); +discordModals(client); //client.config = require("./config.json"); // Initializing the project