mirror of
https://github.com/Art-Portal/April.git
synced 2024-11-16 11:37:37 +01:00
Add role requirement to open a ticket
This commit is contained in:
parent
1ba27c15f7
commit
283eaa15f4
@ -1,8 +1,16 @@
|
||||
const { ActionRowBuilder, StringSelectMenuBuilder } = require('discord.js')
|
||||
const { ActionRowBuilder, StringSelectMenuBuilder, EmbedBuilder } = require('discord.js')
|
||||
|
||||
module.exports = {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
if(interaction.customId.endsWith("free")){
|
||||
if(
|
||||
!interaction.member.roles.cache.has('1104145272499621928') &&
|
||||
!interaction.member.roles.cache.has('1104146176627970249') &&
|
||||
!interaction.member.roles.cache.has('1104146641721761843') &&
|
||||
!interaction.member.roles.cache.has('1104147264500400142')
|
||||
) return interaction.editReply({ embeds: [hasNotRoleEMBED] })
|
||||
}
|
||||
const ticketgraphismtyperow2 = new ActionRowBuilder()
|
||||
.addComponents(
|
||||
new StringSelectMenuBuilder()
|
||||
@ -59,3 +67,8 @@ module.exports = {
|
||||
await interaction.editReply({ components: [ticketgraphismtyperow2] })
|
||||
}
|
||||
}
|
||||
|
||||
const hasNotRoleEMBED = new EmbedBuilder()
|
||||
.setTitle("Désolé !")
|
||||
.setColor("#db2a06")
|
||||
.setDescription('Pour pouvoir ouvrir un ticket bénévole, vous devez avoir le rôle <@&1104145272499621928> !\nCela nous permet de ne pas être noyés sous les commandes tout en laissant l\'accès aux commandes bénévole possible.!')
|
Loading…
Reference in New Issue
Block a user