Repository navigation
feat: bring gateway threads to discord.js parity - #107
Conversation
◈ PR LensPR Lens paused analysis for this repository — the fair-use limit was reached. It resumes automatically at 2026-09-25T18:00:00.000Z. |
There was a problem hiding this comment.
Important
Thread creation silently defaults to the wrong visibility, and a documented withMember fetch path is unreachable. Both are addressable without touching the rest of the design.
Reviewed changes
Reviewed the full diff of PR #107, which brings packages/plugin-gateway threads to discord.js parity.
channel.threads(ChannelThreadsMixin) on Text/Announcement/Forum/Media channels:create,fetchActive,fetchArchived, backed by a newThreadManager.create/fetchActive/fetchArchived/storeList.- Thread actions on
ThreadChannelMixin:setArchived,setLocked,setInvitable,setAutoArchiveDuration,join,leave,fetchStarterMessage,fetchOwner, and a newmembersaccessor (ThreadChannelMemberManager). ThreadMemberstructure andclient.threadMembers(ThreadMemberManager, aCachedManager), resolvingguildMemberfromclient.members.- New events:
threadListSync,threadMemberUpdate,threadMembersUpdate, wired intoutil/dispatch.ts/util/events.ts(the cache-write side already existed inplugin-cache). - Cache-routing fix:
ChannelManager._addnow hands thread payloads toclient.threads._addinstead of caching them underchannels, fixingclient.channels.editlanding threads in the wrong store — covered by a dedicated test. AppliedTagsMixin#setAppliedTagsfor forum/media thread tags.
Claude Sonnet | 𝕏
@wolfstar/plugin-api
@wolfstar/plugin-cache
@wolfstar/plugin-gateway
@wolfstar/plugin-i18next
@wolfstar/plugin-logger
@wolfstar/plugin-subcommands-advanced
commit: |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed commit 3de5e0f, pushed since the prior Pullfrog review, which fixes both findings raised against 18cfc4e.
- Resolved thread-type default:
ThreadManager.create()now resolves the thread type client-side via a newdefaultThreadType()helper (cache-firstchannels.fetch()) instead of forwardingoptions.typeunresolved —channel.threads.create({ name })now creates a public thread (or an announcement thread in announcement channels) instead of silently landing on Discord's server-sidePRIVATE_THREADdefault.ThreadCreateOptions.typenow includesChannelType.AnnouncementThread, and its JSDoc was corrected to match. - Resolved unreachable
withMemberfetch:ThreadChannelMemberManager#fetch()now accepts awithMemberoption and routes toThreadMemberManager.fetchWithMember()when set, sothread.members.fetch(userId, { withMember: true })is now a working path to a thread member's resolved guild member. - Added tests for both: an omitted-
typetest asserting the sentbody.typeacross a text and an announcement parent, and awithMembertest asserting thewith_member=truequery param.
Verified ThreadChannelType (from discord-api-types) includes AnnouncementThread and that RESTPostAPIChannelThreadsJSONBody.type accepts it, and confirmed CachedManager.fetch() is cache-first so defaultThreadType() doesn't add a REST round-trip when the parent channel is already cached. Both prior review threads addressed and resolved.
Claude Sonnet | 𝕏
3de5e0f to
c4456a9
Compare
c4456a9 to
8975ca4
Compare
|
Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an Add repo secret → · Model settings → · Setup docs → · Ask in Discord →
|
…tch include the guild member
8975ca4 to
57cd2f5
Compare
|
Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an Add repo secret → · Model settings → · Setup docs → · Ask in Discord →
|

Stacked on #106.
🔗 Linked issue
Related to #54 (phase 9 of the roadmap).
🧭 Context
Threads could be read and started from a message, but not created on their own, archived, locked, joined or listed. Thread members only existed as raw cache entries. The thread list and thread member dispatches only reached
raw.📚 Description
Threads now follow discord.js:
channel.threadson text, announcement, forum and media channels (ChannelThreadsMixin):createmakes a public or private thread, or a post with its first message in forums;fetchActiveandfetchArchivedlist threads (public, private, or the joined private ones);guild.fetchActiveThreads()lists a guild's active threads.setArchived,setLocked,setInvitable,setAutoArchiveDuration,setAppliedTags,join,leave,fetchStarterMessageandfetchOwner.ThreadMember,client.threadMembers(aCachedManageron the existingthreadMemberscache) andthread.members. They resolve their guild member from the cache.threadListSync,threadMemberUpdateandthreadMembersUpdate. The removed members are the ones the cache held before the dispatch.Things worth a look:
client.channels.editused to land it in the wrong cache.ChannelManager._addread and wrote the channel cache, while threads live in the thread cache. It now hands threads toclient.threads._add. A test checks that an archived thread stays in the thread cache only.fetchActiveon a channel filters the guild's list, since Discord only lists active threads per guild.Key changes
ThreadMember; thread setters and actions;ChannelThreadsMixin;AppliedTagsMixin#setAppliedTags;Guild#fetchActiveThreadsThreadManagercreate/fetchActive/fetchArchived,ThreadMemberManager(client.threadMembers),ChannelThreadManager,ThreadChannelMemberManager;ChannelManager._addroutes threadsthreadListSync,threadMemberUpdate,threadMembersUpdateType of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.