Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get All Threads(active and archived) from Forum Channel #2577

Open
berkingurcan opened this issue Oct 31, 2023 · 1 comment
Open

Cannot get All Threads(active and archived) from Forum Channel #2577

berkingurcan opened this issue Oct 31, 2023 · 1 comment

Comments

@berkingurcan
Copy link

Description:
Get Active Threads methods cannot get all threads from specific Forum Channel. It gets some threads from the channel.

Expected Behavior:
Can get all active threads from guild and get all archived threads from channel.

Actual Behavior:
I have a Forum Channel which has more than 400 Threads and most of them are active. It is highly crowded server and there are too many messages threads etc.

When I try to use get_guild_active_threads and get_channel_archived_public_threads(or other related methods guild_id.get_active_threads or channel_id.get_archived_public_threads etc.) like this:

    dotenv().ok();

    // Configure the client with your Discord bot token in the environment.
    let token = env::var("DISCORD_TOKEN").expect("Expected a token in the environment");
    // ACTIVE THREAD 
    let forum_channel_id = ChannelId(FORUM_CHANNEL_ID);
    let guild_id = GuildId(GUILD_ID);

    let http = Http::new(&token);
    let mut active_threads = http.get_guild_active_threads(GUILD_ID).await.unwrap();
    println!("New active threads: {:?}", active_threads.threads.len());
    let mut archived_public_threads = http.get_channel_archived_public_threads(FORUM_CHANNEL_ID, None, None).await.unwrap();
    println!("Archived threads: {:?}", archived_public_threads.threads.len());

I get:

New active threads: 124
Archived threads: 50

But I do know that Forum Channel has more that 400 Threads. Even if I filter Guild active threads for the Forum Channel, I get around 60 threads.


So, if the issue is Rate limit is there any method that I can use while paginating? Or am I missing something? Or any idea what is the problem?

Thank you!

@BigBadE
Copy link

BigBadE commented Nov 4, 2024

The issue is the limit on the archived threads, it defaults to 50. Up it to 100, and you'll see 100. You need to read all of them, which is impossible with the current API (it handles before incorrectly, #3014 covers this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants