From fc4bddf82a3b4d8f41a6cbc1ec69d01a3aed789a Mon Sep 17 00:00:00 2001 From: Papaia <43409674+Papaia@users.noreply.github.com> Date: Thu, 4 Jun 2020 14:02:28 +0300 Subject: [PATCH] fix: grammatical errors in INVALID_TYPE errors (#4289) * fix(GuildMemberRoleManager): grammatical error * fix: eslint * fix(GuildChannel): an * fix(PermissionOverwrites): an Co-authored-by: Papaia <43409674+ItsPapaia@users.noreply.github.com> --- src/managers/GuildMemberRoleManager.js | 7 +------ src/structures/GuildChannel.js | 4 ++-- src/structures/PermissionOverwrites.js | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/managers/GuildMemberRoleManager.js b/src/managers/GuildMemberRoleManager.js index f4f530d30..9fc6248f8 100644 --- a/src/managers/GuildMemberRoleManager.js +++ b/src/managers/GuildMemberRoleManager.js @@ -90,12 +90,7 @@ class GuildMemberRoleManager { } else { roleOrRoles = this.guild.roles.resolve(roleOrRoles); if (roleOrRoles === null) { - throw new TypeError( - 'INVALID_TYPE', - 'roles', - 'Role, Snowflake or Array or Collection of Roles or Snowflakes', - true, - ); + throw new TypeError('INVALID_TYPE', 'roles', 'Role, Snowflake or Array or Collection of Roles or Snowflakes'); } await this.client.api.guilds[this.guild.id].members[this.member.id].roles[roleOrRoles.id].put({ reason }); diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 2e80eca71..cb18df0ae 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -227,7 +227,7 @@ class GuildChannel extends Channel { */ updateOverwrite(userOrRole, options, reason) { userOrRole = this.guild.roles.resolve(userOrRole) || this.client.users.resolve(userOrRole); - if (!userOrRole) return Promise.reject(new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role', true)); + if (!userOrRole) return Promise.reject(new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role')); const existing = this.permissionOverwrites.get(userOrRole.id); if (existing) return existing.update(options, reason).then(() => this); @@ -250,7 +250,7 @@ class GuildChannel extends Channel { */ createOverwrite(userOrRole, options, reason) { userOrRole = this.guild.roles.resolve(userOrRole) || this.client.users.resolve(userOrRole); - if (!userOrRole) return Promise.reject(new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role', true)); + if (!userOrRole) return Promise.reject(new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role')); const type = userOrRole instanceof Role ? 'role' : 'member'; const { allow, deny } = PermissionOverwrites.resolveOverwriteOptions(options); diff --git a/src/structures/PermissionOverwrites.js b/src/structures/PermissionOverwrites.js index ea7a45e91..bbc7cd136 100644 --- a/src/structures/PermissionOverwrites.js +++ b/src/structures/PermissionOverwrites.js @@ -174,7 +174,7 @@ class PermissionOverwrites { } const userOrRole = guild.roles.resolve(overwrite.id) || guild.client.users.resolve(overwrite.id); - if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role', true); + if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role'); const type = userOrRole instanceof Role ? 'role' : 'member'; return {