Table of Contents

Class CategoryGuildChannel

Namespace
NetCord
Assembly
NetCord.dll

Represents a category within a guild.

public class CategoryGuildChannel : Channel, IEquatable<Entity>, IJsonModel<JsonChannel>, IInteractionChannel, IGuildChannel, INamedChannel, IEntity, ISpanFormattable, IFormattable
Inheritance
CategoryGuildChannel
Implements
Inherited Members

Constructors

CategoryGuildChannel(JsonChannel, ulong, RestClient)

Represents a category within a guild.

public CategoryGuildChannel(JsonChannel jsonModel, ulong guildId, RestClient client)

Parameters

jsonModel JsonChannel
guildId ulong
client RestClient

Properties

GuildId

The ID corresponding to the channel's parent guild.

public ulong GuildId { get; }

Property Value

ulong

Name

The name of the channel object, between 1 and 100 characters.

public string Name { get; }

Property Value

string

PermissionOverwrites

A list of explicit permission overwrites for specified members and roles.

public IReadOnlyDictionary<ulong, PermissionOverwrite> PermissionOverwrites { get; }

Property Value

IReadOnlyDictionary<ulong, PermissionOverwrite>

Position

The channel's position within the guild channel list.

public int? Position { get; }

Property Value

int?

Remarks

If two or more channels share a position, they are instead sorted by their ID.

Methods

CreateInviteAsync(InviteProperties?, RestRequestProperties?, CancellationToken)

Creates a new invite for a guild channel.

public Task<RestInvite> CreateInviteAsync(InviteProperties? inviteProperties = null, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

inviteProperties InviteProperties

The properties to configure the new invite. Can be null for defaults.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<RestInvite>

DeleteAsync(RestRequestProperties?, CancellationToken)

Deletes a channel.

public Task<CategoryGuildChannel> DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<CategoryGuildChannel>

DeletePermissionAsync(ulong, RestRequestProperties?, CancellationToken)

Deletes a permission overwrite for a user or role in a guild channel.

public Task DeletePermissionAsync(ulong overwriteId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

overwriteId ulong

The ID of the role or user whose permission overwrite is to be deleted.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task

GetAsync(RestRequestProperties?, CancellationToken)

Retrieves a channel by its ID.

public Task<CategoryGuildChannel> GetAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<CategoryGuildChannel>

GetInvitesAsync(RestRequestProperties?, CancellationToken)

Retrieves a list of active invites for a guild channel.

public Task<IReadOnlyList<RestInvite>> GetInvitesAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<IReadOnlyList<RestInvite>>

ModifyAsync(Action<GuildChannelOptions>, RestRequestProperties?, CancellationToken)

Modifies a guild channel's properties.

public Task<CategoryGuildChannel> ModifyAsync(Action<GuildChannelOptions> action, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

action Action<GuildChannelOptions>

An action delegate used to configure the updated channel options.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task<CategoryGuildChannel>

ModifyPermissionsAsync(PermissionOverwriteProperties, RestRequestProperties?, CancellationToken)

Modifies the permissions of a role or user in a guild channel.

public Task ModifyPermissionsAsync(PermissionOverwriteProperties permissionOverwrite, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

permissionOverwrite PermissionOverwriteProperties

The permission overwrite to apply.

properties RestRequestProperties

Optional properties to customize the request, can be null.

cancellationToken CancellationToken

A token that can be used to cancel the operation before it completes.

Returns

Task