Discore
Show / Hide Table of Contents

Method HasPermission

| Improve this Doc View Source

HasPermission(IDiscordGuildMember, DiscordPermission, DiscordGuild, DiscordGuildChannel?)

Returns whether this guild member has a set of permissions within the guild and optionally additionally within a specific guild channel.

Declaration
public static bool HasPermission(this IDiscordGuildMember member, DiscordPermission permissions, DiscordGuild guild, DiscordGuildChannel? channel = null)
Parameters
Type Name Description
IDiscordGuildMember member
DiscordPermission permissions

The set of permissions to check if the member has.

DiscordGuild guild

The guild this member is in.

DiscordGuildChannel channel

A guild channel. If null, channel permissions will not be considered.

Returns
Type Description
bool
Exceptions
Type Condition
ArgumentException

Thrown if member or channel is not in the specified guild

ArgumentNullException

Thrown if member or guild is null.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX