Class RestThreadChannel
Represents a thread channel received over REST.
Inheritance
Implements
Inherited Members
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public class RestThreadChannel : RestTextChannel, IEntity<ulong>, IUpdateable, IRestMessageChannel, IThreadChannel, ITextChannel, IMessageChannel, IMentionable, INestedChannel, IIntegrationChannel, IGuildChannel, IChannel, ISnowflakeEntity, IEntity<ulong>, IDeletable
Properties
| Improve this Doc View SourceAppliedTags
Declaration
public IReadOnlyCollection<ulong> AppliedTags { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<UInt64> |
ArchiveTimestamp
Declaration
public DateTimeOffset ArchiveTimestamp { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
AutoArchiveDuration
Gets the duration of time before the thread is automatically archived after no activity.
Declaration
public ThreadArchiveDuration AutoArchiveDuration { get; }
Property Value
Type | Description |
---|---|
ThreadArchiveDuration |
CreatedAt
Gets when the thread was created.
Declaration
public override DateTimeOffset CreatedAt { get; }
Property Value
Type | Description |
---|---|
DateTimeOffset |
Overrides
Remarks
This property is only populated for threads created after 2022-01-09, hence the default date of this property will be that date.
HasJoined
Declaration
public bool HasJoined { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsArchived
Declaration
public bool IsArchived { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsInvitable
Declaration
public bool? IsInvitable { get; }
Property Value
Type | Description |
---|---|
Nullable<Boolean> |
IsLocked
Declaration
public bool IsLocked { get; }
Property Value
Type | Description |
---|---|
Boolean |
MemberCount
Declaration
public int MemberCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
MessageCount
Declaration
public int MessageCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
OwnerId
Declaration
public ulong OwnerId { get; }
Property Value
Type | Description |
---|---|
UInt64 |
ParentChannelId
Gets the parent text channel id.
Declaration
public ulong ParentChannelId { get; }
Property Value
Type | Description |
---|---|
UInt64 |
PermissionOverwrites
Declaration
public override IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<Overwrite> |
Overrides
Remarks
This method is not supported in threads.
Type
Declaration
public ThreadType Type { get; }
Property Value
Type | Description |
---|---|
ThreadType |
Methods
| Improve this Doc View SourceAddPermissionOverwriteAsync(IRole, OverwritePermissions, RequestOptions)
Adds or updates the permission overwrite for the given role.
Declaration
public override Task AddPermissionOverwriteAsync(IRole role, OverwritePermissions permissions, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IRole | role | The role to add the overwrite to. |
OverwritePermissions | permissions | The overwrite to add to the role. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous permission operation for adding the specified permissions to the channel. |
Overrides
Remarks
This method is not supported in threads.
AddPermissionOverwriteAsync(IUser, OverwritePermissions, RequestOptions)
Adds or updates the permission overwrite for the given user.
Declaration
public override Task AddPermissionOverwriteAsync(IUser user, OverwritePermissions permissions, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The user to add the overwrite to. |
OverwritePermissions | permissions | The overwrite to add to the user. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous permission operation for adding the specified permissions to the channel. |
Overrides
Remarks
This method is not supported in threads.
AddUserAsync(IGuildUser, RequestOptions)
Declaration
public Task AddUserAsync(IGuildUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IGuildUser | user | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
CreateInviteAsync(Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Declaration
public override Task<IInviteMetadata> CreateInviteAsync(int? maxAge, int? maxUses = null, bool isTemporary = false, bool isUnique = false, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Nullable<Int32> | maxAge | |
Nullable<Int32> | maxUses | |
Boolean | isTemporary | |
Boolean | isUnique | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IInviteMetadata> |
Overrides
Remarks
This method is not supported in threads.
CreateInviteToApplicationAsync(UInt64, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Declaration
public override 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 | |
Nullable<Int32> | maxAge | |
Nullable<Int32> | maxUses | |
Boolean | isTemporary | |
Boolean | isUnique | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IInviteMetadata> |
Overrides
Remarks
This method is not supported in threads.
CreateInviteToStreamAsync(IUser, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean, RequestOptions)
Declaration
public override 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 | |
Nullable<Int32> | maxAge | |
Nullable<Int32> | maxUses | |
Boolean | isTemporary | |
Boolean | isUnique | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IInviteMetadata> |
Overrides
Remarks
This method is not supported in threads.
CreateWebhookAsync(String, Stream, RequestOptions)
Creates a webhook in this text channel.
Declaration
public override Task<RestWebhook> CreateWebhookAsync(string name, Stream avatar = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the webhook. |
Stream | avatar | The avatar of the webhook. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestWebhook> | A task that represents the asynchronous creation operation. The task result contains the newly created webhook. |
Overrides
Remarks
This method is not supported in threads.
GetActiveThreadsAsync(RequestOptions)
Gets a collection of active threads within this channel.
Declaration
public override Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<RestThreadChannel>> | A task that represents an asynchronous get operation for retrieving the threads. The task result contains a collection of active threads. |
Overrides
| Improve this Doc View SourceGetCategoryAsync(RequestOptions)
Gets the parent (category) channel of this channel.
Declaration
public override Task<ICategoryChannel> GetCategoryAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
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. |
Overrides
Remarks
This method is not supported in threads.
GetInvitesAsync(RequestOptions)
Declaration
public override Task<IReadOnlyCollection<IInviteMetadata>> GetInvitesAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<IInviteMetadata>> |
Overrides
Remarks
This method is not supported in threads.
GetPermissionOverwrite(IRole)
Gets the permission overwrite for a specific role.
Declaration
public override OverwritePermissions? GetPermissionOverwrite(IRole role)
Parameters
Type | Name | Description |
---|---|---|
IRole | role | The role to get the overwrite from. |
Returns
Type | Description |
---|---|
Nullable<OverwritePermissions> | An overwrite object for the targeted role; null if none is set. |
Overrides
Remarks
This method is not supported in threads.
GetPermissionOverwrite(IUser)
Gets the permission overwrite for a specific user.
Declaration
public override OverwritePermissions? GetPermissionOverwrite(IUser user)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The user to get the overwrite from. |
Returns
Type | Description |
---|---|
Nullable<OverwritePermissions> | An overwrite object for the targeted user; null if none is set. |
Overrides
Remarks
This method is not supported in threads.
GetThreadUsersAsync(Int32, RequestOptions)
Gets a collection of users within this thread.
Declaration
public IAsyncEnumerable<IReadOnlyCollection<RestThreadUser>> GetThreadUsersAsync(int limit = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Int32 | limit | Sets the limit of the user count for each request. 100 by default. |
RequestOptions | options |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IReadOnlyCollection<RestThreadUser>> | A task that represents the asynchronous get operation. The task result contains a collection of thread users found within this thread channel. |
GetUserAsync(UInt64, RequestOptions)
Gets a user within this thread.
Declaration
public Task<RestThreadUser> GetUserAsync(ulong userId, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | userId | The id of the user to fetch. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestThreadUser> | A task representing the asynchronous get operation. The task returns a RestThreadUser if found, otherwise null. |
GetUsersAsync(RequestOptions)
Gets a collection of users within this thread.
Declaration
public async Task<IReadOnlyCollection<RestThreadUser>> GetUsersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<RestThreadUser>> | A task representing the asynchronous get operation. The task returns a
|
GetWebhookAsync(UInt64, RequestOptions)
Gets a webhook available in this text channel.
Declaration
public override Task<RestWebhook> GetWebhookAsync(ulong id, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id | The identifier of the webhook. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<RestWebhook> | A task that represents the asynchronous get operation. The task result contains a webhook associated with the identifier; null if the webhook is not found. |
Overrides
Remarks
This method is not supported in threads.
GetWebhooksAsync(RequestOptions)
Gets the webhooks available in this text channel.
Declaration
public override Task<IReadOnlyCollection<RestWebhook>> GetWebhooksAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<RestWebhook>> | A task that represents the asynchronous get operation. The task result contains a read-only collection of webhooks that is available in this channel. |
Overrides
Remarks
This method is not supported in threads.
JoinAsync(RequestOptions)
Declaration
public Task JoinAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
LeaveAsync(RequestOptions)
Declaration
public Task LeaveAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
ModifyAsync(Action<TextChannelProperties>, RequestOptions)
Declaration
public override async Task ModifyAsync(Action<TextChannelProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<TextChannelProperties> | func | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
Overrides
| Improve this Doc View SourceModifyAsync(Action<ThreadChannelProperties>, RequestOptions)
Declaration
public async Task ModifyAsync(Action<ThreadChannelProperties> func, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
Action<ThreadChannelProperties> | func | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
RemovePermissionOverwriteAsync(IRole, RequestOptions)
Removes the permission overwrite for the given role, if one exists.
Declaration
public override Task RemovePermissionOverwriteAsync(IRole role, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IRole | role | The role to remove the overwrite from. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation for removing the specified permissions from the channel. |
Overrides
Remarks
This method is not supported in threads.
RemovePermissionOverwriteAsync(IUser, RequestOptions)
Removes the permission overwrite for the given user, if one exists.
Declaration
public override Task RemovePermissionOverwriteAsync(IUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The user to remove the overwrite from. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous operation for removing the specified permissions from the channel. |
Overrides
Remarks
This method is not supported in threads.
RemoveUserAsync(IGuildUser, RequestOptions)
Declaration
public Task RemoveUserAsync(IGuildUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IGuildUser | user | |
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |