/
test.js
63 lines (54 loc) · 2.43 KB
/
test.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
60
61
62
63
//=====================================| Import the Module |=====================================\\
const { ChatInputCommandInteraction, Client, EmbedBuilder } = require("discord.js");
//==========< SETTINGS >==========\\
const Config = require("../../../Structures/Settings/config.json");
const Emoji = require("../../../Structures/Settings/emojis.json");
const Embed = require("../../../Structures/Settings/embed.json");
//==========< FUNCTIONS >==========\\
const { errorCmdLogsModal } = require("../../../Structures/Functions/errorCmdLogs.js");
//==========< OTHERS >==========\\
//=====================================| Code |=====================================\\
module.exports = {
name: "modal-test",
category: "Info",
/**
* @param {ChatInputCommandInteraction} interaction
* @param {Client} client
*/
async execute(client, interaction) {
try {
const title = interaction.fields.getTextInputValue("modal-title");
const description = interaction.fields.getTextInputValue("modal-description");
interaction.reply({
ephemeral: true,
embeds: [
new EmbedBuilder()
.setTitle(title)
.setDescription(description)
]
});
} catch (error) {
errorCmdLogsModal(client, interaction, error);
return interaction.reply({
ephemeral: true,
embeds: [
new EmbedBuilder()
.setColor(Embed.Colors.wrongcolor)
.setTitle(`${Emoji.Message.ERROR} Failed To Execute The Modal!`)
.setDescription("I can't execute the code. Please try again later.")
]
});
};
}
};
/**
/////////////////////////////////////////////////////////////////////
//// ////
\\\\ Handlers Coded by GalaXd#9165 \\\\
//// ////
\\\\ Work for MGalaCyber Development | https://galacyber.xyz \\\\
//// ////
\\\\ All Right Reserved! \\\\
//// ////
/////////////////////////////////////////////////////////////////////
*/