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 |
---|---|
Nullable<UInt64> | A |
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 = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Int32> | maxAge | The time (in seconds) until the invite expires. Set to null to never expire. |
Nullable<Int32> | maxUses | The max amount of times this invite may be used. Set to null to have unlimited uses. |
Boolean | isTemporary | If true, the user accepting this invite will be kicked from the guild after closing their client. |
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 |
---|---|
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
CreateInviteToApplicationAsync(DefaultApplications, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Creates a new invite to this channel.
Declaration
Task<IInviteMetadata> CreateInviteToApplicationAsync(DefaultApplications application, int? maxAge, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
DefaultApplications | application | The application to open for this invite. |
Nullable<Int32> | maxAge | The time (in seconds) until the invite expires. Set to null to never expire. |
Nullable<Int32> | maxUses | The max amount of times this invite may be used. Set to null to have unlimited uses. |
Boolean | isTemporary | If true, the user accepting this invite will be kicked from the guild after closing their client. |
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 |
---|---|
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. |
CreateInviteToApplicationAsync(UInt64, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Creates a new invite to this channel.
Declaration
Task<IInviteMetadata> CreateInviteToApplicationAsync(ulong applicationId, int? maxAge, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | applicationId | The id of the embedded application to open for this invite. |
Nullable<Int32> | maxAge | The time (in seconds) until the invite expires. Set to null to never expire. |
Nullable<Int32> | maxUses | The max amount of times this invite may be used. Set to null to have unlimited uses. |
Boolean | isTemporary | If true, the user accepting this invite will be kicked from the guild after closing their client. |
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 |
---|---|
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. |
CreateInviteToStreamAsync(IUser, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Creates a new invite to this channel.
Declaration
Task<IInviteMetadata> CreateInviteToStreamAsync(IUser user, int? maxAge, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The id of the user whose stream to display for this invite. |
Nullable<Int32> | maxAge | The time (in seconds) until the invite expires. Set to null to never expire. |
Nullable<Int32> | maxUses | The max amount of times this invite may be used. Set to null to have unlimited uses. |
Boolean | isTemporary | If true, the user accepting this invite will be kicked from the guild after closing their client. |
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 |
---|---|
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 |
---|---|
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. |
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 |
---|---|
Task<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 |
---|---|
Task | A task that represents the asynchronous operation for syncing channel permissions with its parent's. |