mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
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>
This commit is contained in:
parent
bd349650a7
commit
fc4bddf82a
3 changed files with 4 additions and 9 deletions
|
|
@ -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 });
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue