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:
@@ -51,13 +51,13 @@ class GuildEmojiManager extends BaseGuildEmojiManager {
|
||||
if (roles) {
|
||||
data.roles = [];
|
||||
for (let role of roles instanceof Collection ? roles.values() : roles) {
|
||||
role = this.guild.roles.resolve(role);
|
||||
if (!role) {
|
||||
const roleID = this.guild.roles.resolveID(role);
|
||||
if (!roleID) {
|
||||
return Promise.reject(
|
||||
new TypeError('INVALID_TYPE', 'options.roles', 'Array or Collection of Roles or Snowflakes', true),
|
||||
);
|
||||
}
|
||||
data.roles.push(role.id);
|
||||
data.roles.push(roleID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user