3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Fix "invalid role id" in addrole command

This commit is contained in:
Dark 2021-08-19 19:08:29 +02:00
parent 53fea6b88c
commit 84ff17fd9b
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8

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