Interface IGuildChannel
- Namespace
- NetCord
- Assembly
- NetCord.dll
Represents a channel within a guild.
public interface IGuildChannel : INamedChannel, IEntity, ISpanFormattable, IFormattable
- Inherited Members
Properties
GuildId
The ID corresponding to the channel's parent guild.
ulong GuildId { get; }
Property Value
PermissionOverwrites
A list of explicit permission overwrites for specified members and roles.
IReadOnlyDictionary<ulong, PermissionOverwrite> PermissionOverwrites { get; }
Property Value
Position
The channel's position within the guild channel list.
int? Position { get; }
Property Value
- int?
Remarks
If two or more channels share a position, they are instead sorted by their ID.
Methods
CreateFromJson(JsonChannel, ulong, RestClient)
public static IGuildChannel CreateFromJson(JsonChannel jsonChannel, ulong guildId, RestClient client)
Parameters
jsonChannelJsonChannelguildIdulongclientRestClient
Returns
CreateInviteAsync(InviteProperties?, RestRequestProperties?, CancellationToken)
Creates a new invite for a guild channel.
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
DeletePermissionAsync(ulong, RestRequestProperties?, CancellationToken)
Deletes a permission overwrite for a user or role in a guild channel.
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
GetInvitesAsync(RestRequestProperties?, CancellationToken)
Retrieves a list of active invites for a guild channel.
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.
Task<IGuildChannel> 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.
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.