3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

Fix "invalid role id" in addrole command

This commit is contained in:
Dark 2021-08-19 19:08:29 +02:00
parent c9db9608e6
commit 73955d5b80

View file

@ -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