Vedal mentioned in yesterday's dev stream that the issue is that Discord.NET's GetActiveThreadsAsync uses the /guilds/{guild.id}/threads/active endpoint to fetch the posts from the #1095941852068331560 channel.
As he mentioned the request can timeout due to the insane amount of active posts.
Discord's frontend uses the /channels/{channel.id}/threads/search endpoint which is undocumented.
The important thing about this is that it has a limit url param that limits the max number of threads and messages returned.
For example, when filtering for the evil tag this is the request url:
https://discord.com/api/v9/channels/1095941852068331560/threads/search?archived=true&sort_by=last_message_time&sort_order=desc&limit=25&tag=1343789002502705223&tag_setting=match_some&offset=0
I don't know why archived is set to
truein the request, but the param can be dropped.
Since it is not wrapped by Discord.NET the response would have to be parsed manually, but luckily the starter messages are available in the first_messages array of the response's root element.
private static async Task<string> GetThreads(string token, ulong channelId, int limit = 20) {
using HttpClient http = new();
http.BaseAddress = new Uri("https://discord.com/api/v9/");
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bot", token);
return await http.GetStringAsync($"channels/{channelId}/threads/search?sort_by=last_message_time&sort_order=desc&limit={limit}");
}
While the endpoint is undocumented and is seemingly only used by the Discord client it may change without notice, but maybe it would be worth a try.