mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 10:33:30 +01:00
fix(Resolvables): valid resolvables throw error when uncached (#5495)
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
@@ -53,7 +53,7 @@ class GuildEmojiRoleManager {
|
||||
add(roleOrRoles) {
|
||||
if (roleOrRoles instanceof Collection) return this.add(roleOrRoles.keyArray());
|
||||
if (!Array.isArray(roleOrRoles)) return this.add([roleOrRoles]);
|
||||
roleOrRoles = roleOrRoles.map(r => this.guild.roles.resolve(r));
|
||||
roleOrRoles = roleOrRoles.map(r => this.guild.roles.resolveID(r));
|
||||
|
||||
if (roleOrRoles.includes(null)) {
|
||||
return Promise.reject(new TypeError('INVALID_TYPE', 'roles', 'Array or Collection of Roles or Snowflakes', true));
|
||||
|
||||
Reference in New Issue
Block a user