diff --git a/src/constants.ts b/src/constants.ts index fde2eaf..2caa368 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -69,6 +69,7 @@ const tags = { const roles = { Contributor: '980972470964215870', + SupportCrew: '1184258769312551053', }; export const Constants = { diff --git a/src/discord/help-desk.ts b/src/discord/help-desk.ts index a93932d..1544d00 100644 --- a/src/discord/help-desk.ts +++ b/src/discord/help-desk.ts @@ -69,10 +69,12 @@ export class DiscordHelpDesk { } const members = interaction.guild?.members.cache; - const isContributor = members?.get(interaction.user.id)?.roles.cache.has(Constants.Roles.Contributor); + const userRoles = members?.get(interaction.user.id)?.roles.cache; + const isContributor = userRoles?.has(Constants.Roles.Contributor); + const isSupportCrew = userRoles?.has(Constants.Roles.SupportCrew); - if (!(isContributor || channel.ownerId === interaction.user.id)) { - return interaction.reply({ ephemeral: true, content: 'Only the OP and contributors can close a thread.' }); + if (!(isContributor || isSupportCrew || channel.ownerId === interaction.user.id)) { + return interaction.reply({ ephemeral: true, content: 'Only the OP and team members can close a thread.' }); } const buttonRow = new ActionRowBuilder().addComponents(