mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 12:35:53 +00:00
allow overwritePermissions to take a role id (#792)
* allow overwritePermissions to take a role id * Fix typo
This commit is contained in:
parent
0de3d1bfc4
commit
299484ff68
2 changed files with 5 additions and 2 deletions
File diff suppressed because one or more lines are too long
|
|
@ -111,7 +111,7 @@ class GuildChannel extends Channel {
|
|||
|
||||
/**
|
||||
* Overwrites the permissions for a user or role in this channel.
|
||||
* @param {Role|UserResolvable} userOrRole The user or role to update
|
||||
* @param {RoleResolvable|UserResolvable} userOrRole The user or role to update
|
||||
* @param {PermissionOverwriteOptions} options The configuration for the update
|
||||
* @returns {Promise}
|
||||
* @example
|
||||
|
|
@ -130,6 +130,9 @@ class GuildChannel extends Channel {
|
|||
|
||||
if (userOrRole instanceof Role) {
|
||||
payload.type = 'role';
|
||||
} else if (this.guild.roles.has(userOrRole)) {
|
||||
userOrRole = this.guild.roles.get(userOrRole);
|
||||
payload.type = 'role';
|
||||
} else {
|
||||
userOrRole = this.client.resolver.resolveUser(userOrRole);
|
||||
payload.type = 'member';
|
||||
|
|
|
|||
Loading…
Reference in a new issue