mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-17 17:23:08 +02:00
Implement required roles
This commit is contained in:
parent
53f00b715b
commit
913465a165
@ -161,7 +161,7 @@ log:
|
|||||||
delete: deleted
|
delete: deleted
|
||||||
update: updated
|
update: updated
|
||||||
ticket:
|
ticket:
|
||||||
description: '{user} {verb} ticket'
|
description: '{user} {verb} a ticket'
|
||||||
ticket: Ticket
|
ticket: Ticket
|
||||||
title: Ticket {verb}
|
title: Ticket {verb}
|
||||||
verb:
|
verb:
|
||||||
@ -178,6 +178,9 @@ misc:
|
|||||||
blocked:
|
blocked:
|
||||||
description: You are not allowed to create tickets.
|
description: You are not allowed to create tickets.
|
||||||
title: ❌ Blocked
|
title: ❌ Blocked
|
||||||
|
missing_roles:
|
||||||
|
description: You do not have the roles required to be able to create a ticket in this category.
|
||||||
|
title: ❌ Insufficient roles
|
||||||
no_categories:
|
no_categories:
|
||||||
description: No ticket categories have been configured.
|
description: No ticket categories have been configured.
|
||||||
title: ❌ There are no ticket categories
|
title: ❌ There are no ticket categories
|
||||||
|
@ -112,10 +112,25 @@ module.exports = class TicketManager {
|
|||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: if member !required roles -> stop
|
if (category.requiredRoles.length !== 0) {
|
||||||
|
const missing = category.requiredRoles.some(r => !member.roles.cache.has(r));
|
||||||
|
if (missing) {
|
||||||
|
return await interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
new ExtendedEmbedBuilder({
|
||||||
|
iconURL: interaction.guild.iconURL(),
|
||||||
|
text: category.guild.footer,
|
||||||
|
})
|
||||||
|
.setColor(category.guild.errorColour)
|
||||||
|
.setTitle(getMessage('misc.missing_roles.title'))
|
||||||
|
.setDescription(getMessage('misc.missing_roles.description')),
|
||||||
|
],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: if discordCategory has 50 channels -> stop
|
// TODO: if discordCategory has 50 channels -> stop
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user