Show / Hide Table of Contents

# Interface INestedChannel

Represents a type of guild channel that can be nested within a category.

##### Inherited Members

IGuildChannel.Position
IGuildChannel.Guild
IGuildChannel.GuildId
IGuildChannel.PermissionOverwrites
IGuildChannel.ModifyAsync(Action<GuildChannelProperties>, RequestOptions)
IGuildChannel.GetPermissionOverwrite(IRole)
IGuildChannel.GetPermissionOverwrite(IUser)
IGuildChannel.RemovePermissionOverwriteAsync(IRole, RequestOptions)
IGuildChannel.RemovePermissionOverwriteAsync(IUser, RequestOptions)
IGuildChannel.AddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)
IGuildChannel.AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)
IGuildChannel.GetUsersAsync(CacheMode, RequestOptions)
IGuildChannel.GetUserAsync(UInt64, CacheMode, RequestOptions)
IChannel.Name
ISnowflakeEntity.CreatedAt
IEntity<UInt64>.Id
IDeletable.DeleteAsync(RequestOptions)

###### Namespace: Discord

###### Assembly: Discord.Net.Core.dll

##### Syntax

    public interface INestedChannel : IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable

### Properties

| Improve this Doc View Source

#### CategoryId

Gets the parent (category) ID of this channel in the guild's channel list.

##### Declaration

    ulong? CategoryId { get; }

##### Property Value

Type | Description
--- | ---
System.Nullable<System.UInt64> | A System.UInt64 representing the snowflake identifier of the parent of this channel; `null` if none is set.

### Methods

| Improve this Doc View Source

#### CreateInviteAsync(Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)

Creates a new invite to this channel.

##### Declaration

    Task<IInviteMetadata> CreateInviteAsync(int? maxAge, int? maxUses = default(int? ), bool isTemporary = false, bool isUnique = false, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
System.Nullable<System.Int32> | maxAge | The time (in seconds) until the invite expires. Set to `null` to never expire.
System.Nullable<System.Int32> | maxUses | The max amount of times this invite may be used. Set to `null` to have unlimited uses.
System.Boolean | isTemporary | If `true`, the user accepting this invite will be kicked from the guild after closing their client.
System.Boolean | isUnique | If `true`, don't try to reuse a similar invite (useful for creating many unique one time use invites).
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<IInviteMetadata> | A task that represents the asynchronous invite creation operation. The task result contains an invite metadata object containing information for the created invite.

##### Examples

The following example creates a new invite to this channel; the invite lasts for 12 hours and can only be used 3 times throughout its lifespan.

    await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3);

| Improve this Doc View Source

#### GetCategoryAsync(CacheMode, RequestOptions)

Gets the parent (category) channel of this channel.

##### Declaration

    Task<ICategoryChannel> GetCategoryAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
CacheMode | mode | The CacheMode that determines whether the object should be fetched from cache.
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<ICategoryChannel> | A task that represents the asynchronous get operation. The task result contains the category channel representing the parent of this channel; `null` if none is set.

| Improve this Doc View Source

#### GetInvitesAsync(RequestOptions)

Gets a collection of all invites to this channel.

##### Declaration

    Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyCollection<IInviteMetadata>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of invite metadata that are created for this channel.

##### Examples

The following example gets all of the invites that have been created in this channel and selects the most used invite.

    var invites = await channel.GetInvitesAsync();
    if (invites.Count == 0) return;
    var invite = invites.OrderByDescending(x => x.Uses).FirstOrDefault();

| Improve this Doc View Source

#### SyncPermissionsAsync(RequestOptions)

Syncs the permissions of this nested channel with its parent's.

##### Declaration

    Task SyncPermissionsAsync(RequestOptions options = null)

##### Parameters

Type | Name | Description
--- | --- | ---
RequestOptions | options | The options to be used when sending the request.

##### Returns

Type | Description
--- | ---
System.Threading.Tasks.Task | A task that represents the asynchronous operation for syncing channel permissions with its parent's.