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
jsonModelJsonChannelguildIdulongclientRestClient
Properties
GuildId
The ID corresponding to the channel's parent guild.
public ulong GuildId { get; }
Property Value
Name
The name of the channel object, between 1 and 100 characters.
public string Name { get; }
Property Value
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.
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
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
DeleteAsync(RestRequestProperties?, CancellationToken)
Deletes a channel.
public Task<CategoryGuildChannel> 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<CategoryGuildChannel> 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
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<CategoryGuildChannel> 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.