Table of Contents

Class ForumGuildChannel

Namespace
NetCord
Assembly
NetCord.dll

Represents a forum channel within a guild.

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

Constructors

ForumGuildChannel(JsonChannel, ulong, RestClient)

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

Parameters

jsonModel JsonChannel
guildId ulong
client RestClient

Properties

AvailableTags

The set of tags available for use in the channel.

public IReadOnlyList<ForumTag> AvailableTags { get; }

Property Value

IReadOnlyList<ForumTag>

DefaultForumLayout

The default layout to use for threads within the channel.

public ForumLayoutType DefaultForumLayout { get; }

Property Value

ForumLayoutType

DefaultReactionEmoji

The emoji to display by default as the add reaction button.

public ForumGuildChannelDefaultReaction? DefaultReactionEmoji { get; }

Property Value

ForumGuildChannelDefaultReaction

DefaultSortOrder

The sort order to use for threads within the channel.

public SortOrderType? DefaultSortOrder { get; }

Property Value

SortOrderType?

Remarks

If set to null, indicates no preferred sort order has been set.

DefaultThreadSlowmode

The default slowmode duration for threads within the channel.

public int DefaultThreadSlowmode { get; }

Property Value

int

GuildId

The ID corresponding to the channel's parent guild.

public ulong GuildId { get; }

Property Value

ulong

LastPin

When the last pinned message was pinned. Can be null.

public DateTimeOffset? LastPin { get; }

Property Value

DateTimeOffset?

LastThreadId

The ID of the last thread created in this channel. Can be null.

public ulong? LastThreadId { get; }

Property Value

ulong?

Remarks

May not point to an existing or valid thread.

Name

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

public string Name { get; }

Property Value

string

Nsfw

Whether the channel is age-restricted.

public bool Nsfw { get; }

Property Value

bool

ParentId

The ID of the channel's parent channel.

public ulong? ParentId { get; }

Property Value

ulong?

Remarks

If the channel is a thread, the ID corresponds to the thread's parent channel.

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.

Slowmode

The number of seconds a user has to wait before creating another thread, between 0 and 21600 (6 hours).

public int Slowmode { get; }

Property Value

int

Remarks

Bots, and users with the BypassSlowmode permission are unaffected.

Topic

The channel topic, between 0 and 4096 characters. Can be null.

public string? Topic { get; }

Property Value

string

Methods

CreateForumGuildThreadAsync(ForumGuildThreadProperties, RestRequestProperties?, CancellationToken)

Creates a new thread in a forum channel.

public Task<ForumGuildThread> CreateForumGuildThreadAsync(ForumGuildThreadProperties threadProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

threadProperties ForumGuildThreadProperties

The properties of the forum thread to create.

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

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>

CreateWebhookAsync(WebhookProperties, RestRequestProperties?, CancellationToken)

Creates a new webhook, and returns an IncomingWebhook object on success.

public Task<IncomingWebhook> CreateWebhookAsync(WebhookProperties webhookProperties, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)

Parameters

webhookProperties WebhookProperties

Properties to customize the webhook's appearance.

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

Remarks

Fires a WebhooksUpdate event.

DeleteAsync(RestRequestProperties?, CancellationToken)

Deletes a channel.

public Task<ForumGuildChannel> 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<ForumGuildChannel>

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

GetChannelWebhooksAsync(RestRequestProperties?, CancellationToken)

Returns a list of channel Webhook objects.

public Task<IReadOnlyList<Webhook>> GetChannelWebhooksAsync(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<Webhook>>

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

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