const {
ButtonBuilder,
ButtonStyle,
ActionRowBuilder,
MessageFlags,
TextDisplayBuilder,
ContainerBuilder,
SeparatorBuilder,
SeparatorSpacingSize,
MediaGalleryBuilder,
} = require("discord.js");
const open_questions = require("../../actions/button/whitelist/open_questions");
const whitelistSetup = async (interaction, options) => {
console.log("Whitelist setup started.");
const mediaGallery = new MediaGalleryBuilder()
.addItems([
{
url: "https://r2.fivemanage.com/c5R8i5l3IaIkvuFXePEUX/7f158542f31fd37a120cd08a7cf1493a_720w.gif",
alt: "Reckon City Whitelist",
type: "image"
}
]);
const applyButton = new ButtonBuilder()
.setCustomId(String(open_questions.id))
.setLabel("Apply Whitelist")
.setStyle(ButtonStyle.Secondary);
if (open_questions.emoji) {
applyButton.setEmoji(open_questions.emoji);
} else {
applyButton.setEmoji({ name: 'verify_green', id: '1376781430075686983' });
}
const actionRow = new ActionRowBuilder()
.addComponents(applyButton);
const container_component = new ContainerBuilder()
.setAccentColor(null)
.addMediaGalleryComponents(mediaGallery)
.addTextDisplayComponents(
new TextDisplayBuilder("# RECKON CITY WHITELIST")
)
.addSeparatorComponents(
new SeparatorBuilder().setSpacing(SeparatorSpacingSize.Medium)
)
.addTextDisplayComponents(
new TextDisplayBuilder(
"## Apply Now For Whitelist\n\n" +
"- Interview : - Whitelist Interviews are available 12x7\n\n" +
"- Availability : - We're usually available peak time : 10.00 AM to 11.00 PM\n\n"
)
)
.addActionRowComponents(actionRow)
.addTextDisplayComponents(
new TextDisplayBuilder("### RECKON CITY Management")
);
try {
await interaction.channel.send({
components: [container_component],
flags: MessageFlags.IsComponentV2,
});
await interaction.editReply({
content: "✅ Whitelist setup completed.",
flags: MessageFlags.Ephemeral,
});
} catch (error) {
console.error("Error in whitelist setup:", error);
await interaction.editReply({
content: "❌ Failed to setup whitelist. Please check the logs.",
flags: MessageFlags.Ephemeral,
});
}
};
module.exports = {
command: false,
execute: whitelistSetup,
};
const {
ButtonBuilder,
ButtonStyle,
ActionRowBuilder,
MessageFlags,
TextDisplayBuilder,
ContainerBuilder,
SeparatorBuilder,
SeparatorSpacingSize,
MediaGalleryBuilder,
} = require("discord.js");
const open_questions = require("../../actions/button/whitelist/open_questions");
const whitelistSetup = async (interaction, options) => {
console.log("Whitelist setup started.");
const mediaGallery = new MediaGalleryBuilder()
.addItems([
{
url: "https://r2.fivemanage.com/c5R8i5l3IaIkvuFXePEUX/7f158542f31fd37a120cd08a7cf1493a_720w.gif",
alt: "Reckon City Whitelist",
type: "image"
}
]);
const applyButton = new ButtonBuilder()
.setCustomId(String(open_questions.id))
.setLabel("Apply Whitelist")
.setStyle(ButtonStyle.Secondary);
if (open_questions.emoji) {
applyButton.setEmoji(open_questions.emoji);
} else {
applyButton.setEmoji({ name: 'verify_green', id: '1376781430075686983' });
}
const actionRow = new ActionRowBuilder()
.addComponents(applyButton);
const container_component = new ContainerBuilder()
.setAccentColor(null)
.addMediaGalleryComponents(mediaGallery)
.addTextDisplayComponents(
new TextDisplayBuilder("# RECKON CITY WHITELIST")
)
.addSeparatorComponents(
new SeparatorBuilder().setSpacing(SeparatorSpacingSize.Medium)
)
.addTextDisplayComponents(
new TextDisplayBuilder(
"## Apply Now For Whitelist\n\n" +
"- Interview : - Whitelist Interviews are available 12x7\n\n" +
"- Availability : - We're usually available peak time : 10.00 AM to 11.00 PM\n\n"
)
)
.addActionRowComponents(actionRow)
.addTextDisplayComponents(
new TextDisplayBuilder("### RECKON CITY Management")
);
try {
await interaction.channel.send({
components: [container_component],
flags: MessageFlags.IsComponentV2,
});
await interaction.editReply({
content: "✅ Whitelist setup completed.",
flags: MessageFlags.Ephemeral,
});
} catch (error) {
console.error("Error in whitelist setup:", error);
await interaction.editReply({
content: "❌ Failed to setup whitelist. Please check the logs.",
flags: MessageFlags.Ephemeral,
});
}
};
module.exports = {
command: false,
execute: whitelistSetup,
};