From 9842f19b69ba60cb092a208b21841efe63fdb446 Mon Sep 17 00:00:00 2001 From: matteom0165 Date: Tue, 23 Jul 2024 21:10:16 +0200 Subject: [PATCH] fix: hotfix caching error --- src/common/decoratos/role.decorator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/decoratos/role.decorator.ts b/src/common/decoratos/role.decorator.ts index 1cea156..f70c5f9 100644 --- a/src/common/decoratos/role.decorator.ts +++ b/src/common/decoratos/role.decorator.ts @@ -11,9 +11,9 @@ export function Role(requiredRole: CommandAccessLevel) { descriptor.value = async function (...args) { const interaction: CommandInteraction = args[0]; - const roles = interaction.guild.roles.cache; + const roles = interaction.member.roles as any; if ( - !roles.has(requiredRole) && + !roles?.cache?.has(requiredRole) && requiredRole !== CommandAccessLevel.member ) { await interaction.reply({