2023-02-20 00:20:35 +00:00
|
|
|
const { SlashCommandBuilder } = require('discord.js');
|
2023-02-12 16:46:06 +00:00
|
|
|
const fn = require('../modules/functions.js');
|
2023-02-20 00:20:35 +00:00
|
|
|
const strings = require('../data/strings.json');
|
2023-02-12 16:46:06 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
data: new SlashCommandBuilder()
|
|
|
|
.setName('rolemenu')
|
2023-02-20 00:20:35 +00:00
|
|
|
.setDescription('Send a self-assignable role selection menu'),
|
2023-02-12 16:46:06 +00:00
|
|
|
async execute(interaction) {
|
2023-02-20 00:20:35 +00:00
|
|
|
await interaction.deferReply().catch(e => console.error(e));
|
2023-02-12 20:29:38 +00:00
|
|
|
if (interaction.client.guildInfos.has(interaction.guildId)) {
|
|
|
|
let guildInfo = interaction.client.guildInfos.get(interaction.guildId);
|
2023-02-20 00:20:35 +00:00
|
|
|
await interaction.editReply(fn.builders.embeds.treeRoleMenu(guildInfo)).catch(e => console.error(e));
|
2023-02-12 20:29:38 +00:00
|
|
|
} else {
|
2023-02-20 00:20:35 +00:00
|
|
|
await interaction.editReply(fn.builders.errorEmbed(strings.status.noRoleMenu)).catch(e => console.error(e));
|
2023-02-12 20:29:38 +00:00
|
|
|
}
|
2023-02-12 16:46:06 +00:00
|
|
|
},
|
|
|
|
};
|