Class AnnouncementGuildChannel
- Namespace
- NetCord
- Assembly
- NetCord.dll
Represents a channel that users can follow and crosspost from into their own servers. Formerly known as news channels.
public class AnnouncementGuildChannel : TextGuildChannel, IEquatable<Entity>, IJsonModel<JsonChannel>, IInteractionChannel, IGuildChannel, INamedChannel, IEntity, ISpanFormattable, IFormattable
- Inheritance
-
AnnouncementGuildChannel
- Implements
- Inherited Members
Constructors
AnnouncementGuildChannel(JsonChannel, ulong, RestClient)
Represents a channel that users can follow and crosspost from into their own servers. Formerly known as news channels.
public AnnouncementGuildChannel(JsonChannel jsonModel, ulong guildId, RestClient client)
Parameters
jsonModelJsonChannelguildIdulongclientRestClient
Methods
CrosspostMessageAsync(ulong, RestRequestProperties?, CancellationToken)
Crossposts a message from an announcement channel to subscribed channels.
public Task<RestMessage> CrosspostMessageAsync(ulong messageId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
messageIdulongThe ID of the message to crosspost.
propertiesRestRequestPropertiesOptional properties to customize the request, can be null.
cancellationTokenCancellationTokenA token that can be used to cancel the operation before it completes.
Returns
DeleteAsync(RestRequestProperties?, CancellationToken)
Deletes a channel.
public Task<AnnouncementGuildChannel> 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
FollowAsync(ulong, RestRequestProperties?, CancellationToken)
Follows an announcement channel to another channel.
public Task<FollowedChannel> FollowAsync(ulong webhookChannelId, RestRequestProperties? properties = null, CancellationToken cancellationToken = default)
Parameters
webhookChannelIdulongThe ID of the channel to receive crossposted messages.
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<AnnouncementGuildChannel> 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
ModifyAsync(Action<GuildChannelOptions>, RestRequestProperties?, CancellationToken)
Modifies a guild channel's properties.
public Task<AnnouncementGuildChannel> 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.