-
Notifications
You must be signed in to change notification settings - Fork 0
/
modal.js
59 lines (49 loc) · 1.97 KB
/
modal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const { ChatInputCommandInteraction, SlashCommandBuilder, ModalBuilder, ActionRowBuilder, TextInputStyle, TextInputBuilder } = require('discord.js');
module.exports = {
developer: true,
data: new SlashCommandBuilder()
.setName("modal")
.setDescription("Returns a modal"),
/**
*
* @param {ChatInputCommandInteraction} interaction
*/
execute(interaction){
const modal = new ModalBuilder()
.setCustomId('checkmateModal')
.setTitle('Registration Form')
const nameInput = new TextInputBuilder()
.setCustomId('nameInput')
.setLabel('Full Name:')
.setStyle(TextInputStyle.Short)
.setRequired(true);
const regdInput = new TextInputBuilder()
.setCustomId('regdInput')
.setLabel('Registration Number:')
.setStyle(TextInputStyle.Short)
.setRequired(true);
const emailInput = new TextInputBuilder()
.setCustomId('emailInput')
.setLabel('Email Id:')
.setStyle(TextInputStyle.Short)
.setRequired(true);
const contactInput = new TextInputBuilder()
.setCustomId('contactInput')
.setLabel('Contact Info:')
.setStyle(TextInputStyle.Short)
.setRequired(true);
const yearInput = new TextInputBuilder()
.setCustomId('yearInput')
.setLabel('Current Year:')
.setStyle(TextInputStyle.Short)
.setRequired(true)
.setPlaceholder("1/2/3/4");
const firstActionRow = new ActionRowBuilder().addComponents(nameInput);
const secondActionRow = new ActionRowBuilder().addComponents(regdInput);
const thirdActionRow = new ActionRowBuilder().addComponents(emailInput);
const fourthActionRow = new ActionRowBuilder().addComponents(contactInput);
const fifthActionRow = new ActionRowBuilder().addComponents(yearInput);
modal.addComponents(firstActionRow, secondActionRow, thirdActionRow, fourthActionRow, fifthActionRow);
interaction.showModal(modal);
}
}