Fix GetActiveThreadsAsync & add it to ITextChannel (#2526)

* fix `GetActiveThreadsAsync` being sadge

* ah, forgot about mocked channel
This commit is contained in:
Misha133
2022-12-14 09:56:06 +03:00
committed by GitHub
parent 55280a569e
commit bd2f719774
11 changed files with 51 additions and 8 deletions

View File

@@ -68,10 +68,10 @@ namespace Discord.Rest
return await client.ApiClient.ModifyThreadAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
}
public static async Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(IGuild guild, BaseDiscordClient client, RequestOptions options)
public static async Task<IReadOnlyCollection<RestThreadChannel>> GetActiveThreadsAsync(IGuild guild, ulong channelId, BaseDiscordClient client, RequestOptions options)
{
var result = await client.ApiClient.GetActiveThreadsAsync(guild.Id, options).ConfigureAwait(false);
return result.Threads.Select(x => RestThreadChannel.Create(client, guild, x)).ToImmutableArray();
return result.Threads.Where(x => x.CategoryId == channelId).Select(x => RestThreadChannel.Create(client, guild, x)).ToImmutableArray();
}
public static async Task<IReadOnlyCollection<RestThreadChannel>> GetPublicArchivedThreadsAsync(IGuildChannel channel, BaseDiscordClient client, int? limit = null,