Interface INestedChannel
Represents a type of guild channel that can be nested within a category.
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public interface INestedChannel : IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties
| Improve this Doc View SourceCategoryId
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;
|
Methods
| Improve this Doc View SourceCreateInviteAsync(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 |
| System.Nullable<System.Int32> | maxUses | The max amount of times this invite may be used. Set to |
| System.Boolean | isTemporary | If |
| System.Boolean | isUnique | If |
| 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; |
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. |