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

Get Archived Public Threads not properly fetched for Announcement Channels (and former Announcement Channels) #7341

Open
AngryCoffeeMan opened this issue Jan 12, 2025 · 3 comments
Labels
bug synced Synced to internal tracker

Comments

@AngryCoffeeMan
Copy link

Description

I noticed when I called /channels/<channel_id>/threads/archived/public on a Channel that was recently turned into an Announcement Channel, it did not give me all the Archived Threads, only Archived Threads after it became an Announcement Channel. I tried to turn it into a Regular Channel, and then it did give me the other Threads, but not the ones made while it was an Announcement Channel.

I believe this issue is caused because the API probably only searches for ANNOUNCEMENT_THREAD (10) or PUBLIC_THREAD (11) depending on it's channel type, and neither are converted to other when the Channel Type is converted.

I propose the following as alternatives for solutions:
Solution 1: Make /channels/<channel_id>/threads/archived/public search for ANNOUNCEMENT_THREAD (10) and PUBLIC_THREAD (11) regardless of Channel Type.
Solution 2: When converting from Text Channel (0) to Announcement Channel (5), convert all PUBLIC_THREAD (11) to ANNOUNCEMENT_THREAD (10), and vice versa. All current PUBLIC_THREAD (11) and ANNOUNCEMENT_THREAD (10) would need to be converted to their appropriate type, this might consume excessive resources, which is why I would recommend Solution 1

Steps to Reproduce

  • Create a Text Channel (Channel A)
  • Make a Public Thread (Thread A) [PUBLIC_THREAD (11)]
  • Archive Thread A
  • Go into the Settings for Channel A, and turn Announcement Channel on.
  • Call /channels/<channel_a>/threads/archived/public, with channel_a being the ID of Channel A. (API Call 1)
  • Make a Public Thread (Thread B) [ANNOUNCEMENT_THREAD (10)]
  • Archive Thread B
  • Go into the Settings for Channel A, and turn Announcement Channel off.
  • Call /channels/<channel_a>/threads/archived/public, with channel_a being the ID of Channel A. (API Call 2)

Expected Behavior

API Call 1 should return Thread A
API Call 2 should return Thread A and Thread B

Current Behavior

API Call 1 returns nothing.
API Call 2 returns just Thread A

Screenshots/Videos

No response

Client and System Information

Discord API version 10 (Bot) using API with Standalone HTTPS Request through Undici (Version 7.2.0).

@Zoddo
Copy link
Contributor

Zoddo commented Jan 12, 2025

Solution 2: When converting from Text Channel (0) to Announcement Channel (5), convert all PUBLIC_THREAD (11) to ANNOUNCEMENT_THREAD (10), and vice versa. All current PUBLIC_THREAD (11) and ANNOUNCEMENT_THREAD (10) would need to be converted to their appropriate type, this might consume excessive resources, which is why I would recommend Solution 1

I want to add that solution 2 would be a breaking change from the documented behavior, so I would vote for solution 1 too.

Or if solution 2 is the chosen solution, an advance notice with a proper ""deprecation"" period will be required so libs and bots can adjust their code to allow for on-the-fly conversion between the 2 channel types.

@advaith1
Copy link
Contributor

your code should not break if you receive a channel type change that is not text <-> news

@Qjuh
Copy link
Contributor

Qjuh commented Jan 13, 2025

And yet it might for a library that has separate classes for separate channel types. Since changing channel types are indeed not documented anywhere apart from the text<->announcement channel change.

@Rodentman87 Rodentman87 added the synced Synced to internal tracker label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug synced Synced to internal tracker
Projects
None yet
Development

No branches or pull requests

5 participants