Table of Contents

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

ulong

PermissionOverwrites

A list of explicit permission overwrites for specified members and roles.

IReadOnlyDictionary<ulong, PermissionOverwrite> PermissionOverwrites { get; }

Property Value

IReadOnlyDictionary<ulong, PermissionOverwrite>

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

jsonChannel JsonChannel
guildId ulong
client RestClient

Returns

IGuildChannel

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

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>

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

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

GetInvitesAsync(RestRequestProperties?, CancellationToken)

Retrieves a list of active invites for a guild channel.

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.

Task<IGuildChannel> 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<IGuildChannel>

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

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