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

Deal with discord active thread limit #33

Open
richfromm opened this issue Feb 8, 2023 · 2 comments
Open

Deal with discord active thread limit #33

richfromm opened this issue Feb 8, 2023 · 2 comments

Comments

@richfromm
Copy link
Owner

While researching #32, I came across yet another unexpected limit.

https://support.discord.com/hc/en-us/community/posts/360056762431-Increase-channel-limit?page=2#community_comment_4416922099351 claims:

1: Yes, there is a limit of 1000 ACTIVE threads, but you can have an unlimited amount of archived threads.

I have not seen any documentation of this (although plenty of other limits are also undocumented), nor have I tried to replicate it.

Perhaps we should explicitly archive threads when creating them during the import? Or maybe only if they are sufficiently old? And/or maybe only if we are in danger of hitting the limit ? (See Guild.active_threads(), I think we'd need to fetch all of the active threads and count how many there are.)

Note that I'm not entirely sure how to archive a thread via the API. I don't see any kind of archive() method on the Thread class. There is an archived attribute, it's not clear whether that's read-only, or if I can archive a thread just by setting that.

Another related attribute is auto_archive_duration, although again it's not clear if that can be changed by just setting that. Note that the Message.create_thread() method used to create the thread (called on the message that's the root of the thread) does have a parameter auto_archive_duration. (If not provided, a channel default value is used.) But this is measured in minutes. If we're close to the limit, even setting it to 1 minute might not be sufficient unless we substantially artificially slow down the importing of data to Discord. I'd have to test if 0 is a legal value and if that would force the thread to be immediately archived on creation. But even if that worked, would it persist? That is, after creating the thread, would each new message added to the thread in the import cause it to be unarchived? If so, would that be okay if a setting of 0 then caused it to be immediately re-archived?

The bottom line is that some further investigation and testing is required.

@richfromm
Copy link
Owner Author

Attn: @waocats @shmulvad

@waocats
Copy link
Collaborator

waocats commented Feb 9, 2023

That is, after creating the thread, would each new message added to the thread in the import cause it to be unarchived?

Seems so. Since you have access to the channel, you could change the channel-wide value to remove them from the sidebar, and then set it back to its previous value once you're done (or perhaps a bit earlier to account for newer threads).

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