Class SocketThreadChannel
Represents a thread channel inside of a guild.
Inheritance
Implements
Inherited Members
Namespace: Discord.WebSocket
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketThreadChannel : SocketTextChannel, IEntity<ulong>, ISocketMessageChannel, 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.
CurrentUser
Gets the current users within this thread.
Declaration
public SocketThreadUser CurrentUser { get; }
Property Value
Type | Description |
---|---|
SocketThreadUser |
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 |
IsPrivateThread
Declaration
public bool IsPrivateThread { 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 |
Owner
Gets the owner of the current thread.
Declaration
public SocketThreadUser Owner { get; }
Property Value
Type | Description |
---|---|
SocketThreadUser |
ParentChannel
Gets the parent channel this thread resides in.
Declaration
public SocketGuildChannel ParentChannel { get; }
Property Value
Type | Description |
---|---|
SocketGuildChannel |
PermissionOverwrites
Declaration
public override IReadOnlyCollection<Overwrite> PermissionOverwrites { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<Overwrite> |
Overrides
Remarks
This method is not supported in threads.
Type
Gets the type of the current thread channel.
Declaration
public ThreadType Type { get; }
Property Value
Type | Description |
---|---|
ThreadType |
Users
Gets a collection of cached users within this thread.
Declaration
public IReadOnlyCollection<SocketThreadUser> Users { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<SocketThreadUser> |
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)
Adds a user to this thread.
Declaration
public Task AddUserAsync(IGuildUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IGuildUser | user | The IGuildUser to add. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation of adding a member to a thread. |
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.
DownloadUsersAsync(RequestOptions)
Downloads all users that have access to this thread.
Declaration
public async Task DownloadUsersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task representing the asynchronous download operation. |
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 SourceGetInvitesAsync(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.
GetUser(UInt64)
Declaration
public SocketThreadUser GetUser(ulong id)
Parameters
Type | Name | Description |
---|---|---|
UInt64 | id |
Returns
Type | Description |
---|---|
SocketThreadUser |
GetUsersAsync(RequestOptions)
Gets all users inside this thread.
Declaration
public async Task<IReadOnlyCollection<SocketThreadUser>> GetUsersAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyCollection<SocketThreadUser>> | A task representing the download operation. |
Remarks
If all users are not downloaded then this method will call DownloadUsersAsync(RequestOptions) and return the result.
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 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 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)
Removes a user from this thread.
Declaration
public Task RemoveUserAsync(IGuildUser user, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
IGuildUser | user | The IGuildUser to remove from this thread. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation of removing a user from this thread. |
SyncPermissionsAsync(RequestOptions)
Declaration
public override Task SyncPermissionsAsync(RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
RequestOptions | options |
Returns
Type | Description |
---|---|
Task |
Overrides
Remarks
This method is not supported in threads.