Table of Contents

Class DirectoryGuildChannel

Namespace
NetCord
Assembly
NetCord.dll

Represents a hub channel, with listed guilds.

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

Constructors

DirectoryGuildChannel(JsonChannel, ulong, RestClient)

Represents a hub channel, with listed guilds.

public DirectoryGuildChannel(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<DirectoryGuildChannel> 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<DirectoryGuildChannel>

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<DirectoryGuildChannel> 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<DirectoryGuildChannel>

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<DirectoryGuildChannel> 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<DirectoryGuildChannel>

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