mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +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:
@@ -911,11 +911,11 @@ class Guild extends Base {
|
||||
if (options.roles) {
|
||||
const roles = [];
|
||||
for (let role of options.roles instanceof Collection ? options.roles.values() : options.roles) {
|
||||
role = this.roles.resolve(role);
|
||||
if (!role) {
|
||||
let roleID = this.roles.resolveID(role);
|
||||
if (!roleID) {
|
||||
throw new TypeError('INVALID_TYPE', 'options.roles', 'Array or Collection of Roles or Snowflakes', true);
|
||||
}
|
||||
roles.push(role.id);
|
||||
roles.push(roleID);
|
||||
}
|
||||
options.roles = roles;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user