Advertisement
Radicatte

Untitled

Jun 26th, 2022
813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { SlashCommandBuilder } = require('@discordjs/builders');
  2. const { Client, Intents, MessageActionRow, Modal, TextInputComponent, MessageButton, MessageEmbed, showModal } = require('discord.js');
  3. const client = new Client({
  4.     intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
  5. });
  6.  
  7. module.exports = {
  8.     data: new SlashCommandBuilder()
  9.         .setName('shanklygates')
  10.         .setDescription('Deploys Shankly gate UI'),
  11.     async execute(interaction) {
  12.         const row = new MessageActionRow()
  13.             .addComponents(
  14.                 new MessageButton()
  15.                     .setCustomId('shanklyButton')
  16.                     .setLabel('Join')
  17.                     .setStyle('DANGER'),
  18.             );
  19.  
  20.         const welcomeEmbed = new MessageEmbed()
  21.             .setColor('#d00027')
  22.             .setTitle('Welcome to Liverpool FC Discord Server!')
  23.             .setImage('https://cdn.discordapp.com/attachments/811546590191419433/990282368650739732/Welcome.png')
  24.             .setURL(`https://www.discord.gg/liverpoolfc`);
  25.  
  26.         const infoEmbed = new MessageEmbed()
  27.             .setColor('#d00027')
  28.             .setTitle('How to join Liverpool Football Club Discord Server')
  29.             .setFooter({ text: 'Liverpool FC Discord Server', iconURL: 'https://cdn.discordapp.com/attachments/811546590191419433/917511139280162836/lfc2021_4.png', URL: 'https://discord.gg/liverpoolfc' })
  30.             .addFields(
  31.                 { name: 'Step 1', value: 'Please read the <#892776969417146449> channel.', inline: false },
  32.                 { name: 'Step 2', value: 'Please state what club you support. Be honest.', inline: false },
  33.                 { name: 'Please Note', value: 'This is not automated. Please wait __***patiently***__ for Staff to assign a role.', inline: false },
  34.             );
  35.  
  36.         await interaction.reply({ embeds: [welcomeEmbed, infoEmbed], components: [row] });
  37.     }
  38. }
  39.  
  40.  
  41. client.on('interactionCreate', async (interaction) => {
  42.     if (interaction.isButton()) {
  43.         if (interaction.customId === 'shanklyButton') {
  44.             const modal = new Modal()
  45.                 .setCustomId('myModal')
  46.                 .setTitle('Modal Title test');
  47.             const footballClubInput = new TextInputComponent()
  48.                 .setCustomId('footballClubInput')
  49.                 .setLabel("What Football Clubs do you support?")
  50.                 .setStyle('PARAGRAPH');
  51.             const firstActionRow = new MessageActionRow().addComponents(footballClubInput);
  52.             modal.addComponents(firstActionRow);
  53.             await interaction.showModal(modal);
  54.  
  55.             showModal(modal, {
  56.                 client,
  57.                 interaction,
  58.             });
  59.         }
  60.     }
  61. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement