mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Improve GuildMember.permissionsIn failure
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -168,16 +168,14 @@ class GuildMember {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns `guildChannel.permissionsFor(guildMember)`. Returns evaluated permissions for a member in a guild channel.
|
||||
* @param {ChannelResolvable} guildChannel the guild channel to use as context
|
||||
* Returns `channel.permissionsFor(guildMember)`. Returns evaluated permissions for a member in a guild channel.
|
||||
* @param {ChannelResolvable} channel Guild channel to use as context
|
||||
* @returns {?EvaluatedPermissions}
|
||||
*/
|
||||
permissionsIn(guildChannel) {
|
||||
guildChannel = this.client.resolver.resolveChannel(guildChannel);
|
||||
if (!guildChannel) {
|
||||
throw new Error('supply a channel resolvable that resolves to a GuildChannel!');
|
||||
}
|
||||
return guildChannel.permissionsFor(this);
|
||||
permissionsIn(channel) {
|
||||
channel = this.client.resolver.resolveChannel(channel);
|
||||
if (!channel || !channel.guild) throw new Error('Could not resolve channel to a guild channel.');
|
||||
return channel.permissionsFor(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user