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
jsonModelJsonChannelguildIdulongclientRestClient
Properties
AvailableTags
The set of tags available for use in the channel.
public IReadOnlyList<ForumTag> AvailableTags { get; }
Property Value
DefaultForumLayout
The default layout to use for threads within the channel.
public ForumLayoutType DefaultForumLayout { get; }
Property Value
DefaultReactionEmoji
The emoji to display by default as the add reaction button.
public ForumGuildChannelDefaultReaction? DefaultReactionEmoji { get; }
Property Value
DefaultSortOrder
The sort order to use for threads within the channel.
public SortOrderType? DefaultSortOrder { get; }
Property Value
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
GuildId
The ID corresponding to the channel's parent guild.
public ulong GuildId { get; }
Property Value
LastPin
When the last pinned message was pinned. Can be null.
public DateTimeOffset? LastPin { get; }
Property Value
LastThreadId
The ID of the last thread created in this channel. Can be null.
public ulong? LastThreadId { get; }
Property Value
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
Nsfw
Whether the channel is age-restricted.
public bool Nsfw { get; }
Property Value
ParentId
The ID of the channel's parent channel.
public ulong? ParentId { get; }
Property Value
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
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
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
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
threadPropertiesForumGuildThreadPropertiesThe properties of the forum thread to create.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
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
invitePropertiesInvitePropertiesThe properties to configure the new invite. Can be null for defaults.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
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
webhookPropertiesWebhookPropertiesProperties to customize the webhook's appearance.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
Remarks
Fires a WebhooksUpdate event.
DeleteAsync(RestRequestProperties?, CancellationToken)
Deletes a channel.
public Task<ForumGuildChannel> DeleteAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
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
overwriteIdulongThe ID of the role or user whose permission overwrite is to be deleted.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
GetAsync(RestRequestProperties?, CancellationToken)
Retrieves a channel by its ID.
public Task<ForumGuildChannel> GetAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
GetChannelWebhooksAsync(RestRequestProperties?, CancellationToken)
Returns a list of channel Webhook objects.
public Task<IReadOnlyList<Webhook>> GetChannelWebhooksAsync(RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
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
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
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
actionAction<GuildChannelOptions>An action delegate used to configure the updated channel options.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
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
permissionOverwritePermissionOverwritePropertiesThe permission overwrite to apply.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.