Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { SlashCommandBuilder } = require('@discordjs/builders');
- const { Client, Intents, MessageActionRow, Modal, TextInputComponent, MessageButton, MessageEmbed, showModal } = require('discord.js');
- const client = new Client({
- intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
- });
- module.exports = {
- data: new SlashCommandBuilder()
- .setName('shanklygates')
- .setDescription('Deploys Shankly gate UI'),
- async execute(interaction) {
- const row = new MessageActionRow()
- .addComponents(
- new MessageButton()
- .setCustomId('shanklyButton')
- .setLabel('Join')
- .setStyle('DANGER'),
- );
- const welcomeEmbed = new MessageEmbed()
- .setColor('#d00027')
- .setTitle('Welcome to Liverpool FC Discord Server!')
- .setImage('https://cdn.discordapp.com/attachments/811546590191419433/990282368650739732/Welcome.png')
- .setURL(`https://www.discord.gg/liverpoolfc`);
- const infoEmbed = new MessageEmbed()
- .setColor('#d00027')
- .setTitle('How to join Liverpool Football Club Discord Server')
- .setFooter({ text: 'Liverpool FC Discord Server', iconURL: 'https://cdn.discordapp.com/attachments/811546590191419433/917511139280162836/lfc2021_4.png', URL: 'https://discord.gg/liverpoolfc' })
- .addFields(
- { name: 'Step 1', value: 'Please read the <#892776969417146449> channel.', inline: false },
- { name: 'Step 2', value: 'Please state what club you support. Be honest.', inline: false },
- { name: 'Please Note', value: 'This is not automated. Please wait __***patiently***__ for Staff to assign a role.', inline: false },
- );
- await interaction.reply({ embeds: [welcomeEmbed, infoEmbed], components: [row] });
- }
- }
- client.on('interactionCreate', async (interaction) => {
- if (interaction.isButton()) {
- if (interaction.customId === 'shanklyButton') {
- const modal = new Modal()
- .setCustomId('myModal')
- .setTitle('Modal Title test');
- const footballClubInput = new TextInputComponent()
- .setCustomId('footballClubInput')
- .setLabel("What Football Clubs do you support?")
- .setStyle('PARAGRAPH');
- const firstActionRow = new MessageActionRow().addComponents(footballClubInput);
- modal.addComponents(firstActionRow);
- await interaction.showModal(modal);
- showModal(modal, {
- client,
- interaction,
- });
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement