diff --git a/backend/src/utils.ts b/backend/src/utils.ts index b9bd8d92..0c243941 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -1392,8 +1392,8 @@ export async function resolveRoleId(bot: Client, guildId: string, value: string) // Role name const roleList = (await bot.guilds.fetch(guildId as Snowflake)).roles.cache; const role = roleList.filter(x => x.name.toLocaleLowerCase() === value.toLocaleLowerCase()); - if (role[0]) { - return role[0].id; + if (role.size >= 1) { + return role.firstKey(); } // Role ID