Table of Contents
API reference

Method GetRolePermissionsAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

GetRolePermissionsAsync(ulong, bool?, CancellationToken)

Gets the role's channel permissions from Discord.

public Task<Permissions> GetRolePermissionsAsync(ulong roleId, bool? includeImplicit = null, CancellationToken cancellationToken = default)

Parameters

roleId ulong

The ID of the role.

includeImplicit bool?

Whether to include implicit permissions. Leave null to use Discord's default.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Permissions>

The computed permissions, including channel overwrites.

Exceptions

InvalidOperationException

Thrown when the channel does not belong to a guild.

GetRolePermissionsAsync(DiscordRole, bool?, CancellationToken)

Gets the role's channel permissions from Discord.

public Task<Permissions> GetRolePermissionsAsync(DiscordRole role, bool? includeImplicit = null, CancellationToken cancellationToken = default)

Parameters

role DiscordRole

The role to get permissions for.

includeImplicit bool?

Whether to include implicit permissions. Leave null to use Discord's default.

cancellationToken CancellationToken

A token to cancel the request.

Returns

Task<Permissions>

The computed permissions, including channel overwrites.

Exceptions

ArgumentNullException

Thrown when role is null.

ArgumentException

Thrown when the role belongs to a different guild.