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

Merge branch 'master' of github.com:Dragory/ZeppelinBot

This commit is contained in:
Dragory 2021-08-19 21:23:11 +03:00
commit 38ea14a442
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

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