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:
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
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue