mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
Fix "invalid role id" in addrole command
This commit is contained in:
parent
53fea6b88c
commit
84ff17fd9b
1 changed files with 2 additions and 2 deletions
|
@ -1392,8 +1392,8 @@ export async function resolveRoleId(bot: Client, guildId: string, value: string)
|
||||||
// Role name
|
// Role name
|
||||||
const roleList = (await bot.guilds.fetch(guildId as Snowflake)).roles.cache;
|
const roleList = (await bot.guilds.fetch(guildId as Snowflake)).roles.cache;
|
||||||
const role = roleList.filter(x => x.name.toLocaleLowerCase() === value.toLocaleLowerCase());
|
const role = roleList.filter(x => x.name.toLocaleLowerCase() === value.toLocaleLowerCase());
|
||||||
if (role[0]) {
|
if (role.size >= 1) {
|
||||||
return role[0].id;
|
return role.firstKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Role ID
|
// Role ID
|
||||||
|
|
Loading…
Add table
Reference in a new issue