Browse Source

add `OwnerId` to threads

pull/2521/head
Misha133 2 years ago
parent
commit
fdcc890cc5
3 changed files with 13 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs
  2. +5
    -0
      src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs
  3. +3
    -0
      src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs

+ 5
- 0
src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs View File

@@ -74,6 +74,11 @@ namespace Discord
/// </remarks>
new DateTimeOffset CreatedAt { get; }

/// <summary>
/// Gets the id of the creator of the thread.
/// </summary>
ulong OwnerId { get; }

/// <summary>
/// Joins the current thread.
/// </summary>


+ 5
- 0
src/Discord.Net.Rest/Entities/Channels/RestThreadChannel.cs View File

@@ -40,6 +40,9 @@ namespace Discord.Rest
/// <inheritdoc/>
public IReadOnlyCollection<ulong> AppliedTags { get; private set; }

/// <inheritdoc/>
public ulong OwnerId { get; private set; }

/// <inheritdoc cref="IThreadChannel.CreatedAt"/>
public override DateTimeOffset CreatedAt { get; }

@@ -76,6 +79,8 @@ namespace Discord.Rest
IsLocked = model.ThreadMetadata.Value.Locked.GetValueOrDefault(false);
}

OwnerId = model.OwnerId.GetValueOrDefault(0);

MemberCount = model.MemberCount.GetValueOrDefault(0);
MessageCount = model.MessageCount.GetValueOrDefault(0);
Type = (ThreadType)model.Type;


+ 3
- 0
src/Discord.Net.WebSocket/Entities/Channels/SocketThreadChannel.cs View File

@@ -95,6 +95,9 @@ namespace Discord.WebSocket
/// <inheritdoc cref="IThreadChannel.CreatedAt"/>
public override DateTimeOffset CreatedAt { get; }

/// <inheritdoc cref="IThreadChannel.OwnerId"/>
ulong IThreadChannel.OwnerId => _ownerId;

/// <summary>
/// Gets a collection of cached users within this thread.
/// </summary>


Loading…
Cancel
Save