From 23460dfdbff658cc0ee247d10dff1814b0623598 Mon Sep 17 00:00:00 2001 From: Ryahn Date: Mon, 12 May 2025 17:50:07 -0500 Subject: [PATCH] Possible fix --- commands/register.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/commands/register.js b/commands/register.js index c7ee6cd..30f8af5 100644 --- a/commands/register.js +++ b/commands/register.js @@ -32,10 +32,12 @@ module.exports = { try { // If not in DM, check for permissions and roles if (message.channel.type !== 'DirectMessage') { - // Check if user has any of the required roles - const hasRequiredRole = message.member.roles.some(role => - module.exports.config.roles.includes(role.toLowerCase()) - ); + // Get allowed role IDs from config + const allowedRoleIds = module.exports.config.roles + .map(roleName => botConfig.roles[0][roleName]) + .filter(Boolean); + + const hasRequiredRole = message.member.roles.some(roleId => allowedRoleIds.includes(roleId)); if (!hasRequiredRole && !client.config.owners.includes(message.authorId)) { return message.reply({