Repository navigation
Description
Context
Tracking issue for complete manager parity between @wolfstar/plugin-gateway and discord.js' packages/discord.js/src/managers (40 files on main). Until now the manager work was split in sub-projects (cache core, collection results, scoped managers, structure contracts), each shipping part of the picture, and the remaining gaps are only spread across individual issues (#207, #208, #209) or not tracked at all. This issue lists every manager that is still missing or only partly ported, so the work can be planned and closed against a single checklist.
The comparison below was made file by file and method by method against discord.js main and the current packages/plugin-gateway/src/managers. Parity here means coverage of managers, methods and access paths, not identical signatures: the cache stays pluggable (CachedManager, synchronous or asynchronous), so a few discord.js shapes keep their Awaitable equivalents.
Already at parity
BaseManager, DataManager, CachedManager, ChannelManager, GuildManager, GuildMemberManager, GuildMemberRoleManager, GuildEmojiManager, GuildEmojiRoleManager, GuildStickerManager, GuildSoundboardSoundManager, GuildScheduledEventManager, GuildInviteManager, GuildBanManager, AutoModerationRuleManager, StageInstanceManager, RoleManager, PermissionOverwriteManager, PresenceManager, VoiceStateManager, ReactionManager, ReactionUserManager, ThreadManager, ThreadMemberManager, UserManager, MessageManager, plus the guild/channel/thread/message scoped variants (ChannelMessageManager, ChannelThreadManager, ThreadChannelMemberManager) and the manager-only extras this package already adds (GuildIntegrationManager, GuildTemplateManager, WebhookManager).
Gaps
1. Application managers (already tracked)
| discord.js | Status |
|---|---|
ApplicationCommandManager, GuildApplicationCommandManager, ApplicationCommandPermissionsManager |
missing, tracked in #209 |
ApplicationEmojiManager |
missing, tracked in #207 |
ClientApplication (client.application), prerequisite of both |
missing, tracked in #208 |
2. Monetization managers (not tracked yet)
| discord.js | Status |
|---|---|
EntitlementManager: fetch() (one, or many with userId, skuIds, excludeEnded, excludeDeleted, guildId, before/after/limit), createTest(), deleteTest(), consume() |
missing; only the EntitlementResolvable type exists |
SubscriptionManager: fetch() (one by ID, or the SKU's subscriptions with userId, before/after/limit) |
missing |
structures they return: Entitlement, Subscription, SKU |
missing |
client.application.entitlements and sku.subscriptions hang off ClientApplication (#208) and SKU, so this part depends on #208.
3. Access paths still missing
discord.js reaches these managers from the structure they belong to. Here several exist only as client-level managers, or not at all:
| discord.js | plugin-gateway |
|---|---|
guild.members (GuildMemberManager) |
only client.members |
guild.roles (RoleManager) |
only client.roles |
guild.presences (PresenceManager) |
no guild-scoped access |
guild.voiceStates (VoiceStateManager) |
no guild-scoped access |
guild.commands (GuildApplicationCommandManager) |
missing, see #209 |
category.children (CategoryChannelChildManager) |
missing, see below |
answer.voters (PollAnswerVoterManager#fetch) |
only message.fetchPollAnswerVoters() and a method on PollAnswer |
CategoryChannelChildManager (category.children)
Ported from CategoryChannelChildManager.js. In discord.js it is a DataManager of GuildChannels that is not backed by its own cache:
channel: the category it belongs to, andguild:channel.guild.cache: the guild's cached channels filtered byparentId === category.id, returned as aCollection. Here the guild channel cache is pluggable, so with an asynchronous cache (Redis) this read has to follow the same rule as the other derived getters: a promise built from the cache alone, typed throughCacheRead<T>.create(options):guild.channels.create({ ...options, parent: category.id }).CategoryCreateChannelOptionsisGuildChannelCreateOptionsminusparent, and a category cannot be created inside a category (ChannelType.GuildCategoryis rejected by the type and at runtime).- Inherited
resolve()andresolveId()fromDataManager.
Wiring: a children getter on CategoryChannel (structures/channels/CategoryChannel.ts) returning the manager, created lazily like ChannelThreadsMixin#threads. It depends on GuildChannelManager#create (already present) and on the parentId field exposed by ChannelParentMixin.
Scoped managers already shipped (guild.emojis, guild.stickers, guild.channels, guild.invites, guild.bans, guild.scheduledEvents, guild.stageInstances, guild.soundboardSounds, guild.integrations, guild.autoModerationRules, channel.messages, channel.threads, channel.permissionOverwrites, thread.members, member.roles, message.reactions) are not part of this list.
4. Missing methods on managers that otherwise exist
| discord.js | Where | Status |
|---|---|---|
GuildManager#fetchSoundboardSounds(guildIds) (gateway request for the sounds of several guilds) |
GuildManager |
missing |
GuildManager#widgetImageURL(guild, style?) |
GuildManager |
missing |
GuildChannelManager#channelCountWithoutThreads |
GuildChannelManager |
missing |
GuildChannelManager#rawFetchGuildActiveThreads() |
GuildChannelManager |
missing (ChannelThreadManager#fetchActive covers the public part) |
DataManager#valueOf() |
DataManager |
missing |
GuildEmojiManager#resolveIdentifier() |
GuildEmojiManager |
missing (only the reaction helper exists) |
5. To verify before closing
GuildTextThreadManagerandGuildForumThreadManagerare separate classes in discord.js (create()takes different options for text and forum channels); hereChannelThreadManager#createis shared. Check that the forum options (message,appliedTags,rateLimitPerUser) are typed and validated per channel type.DMMessageManagerandPartialGroupDMMessageManagerare thin subclasses ofMessageManager(DMChannel#messages, group DM channels). Check thatChannelMessageManagerbehaves the same for DM channels, including the missingcrosspostand guild-only paths.GuildMessageManager#crosspostandChannelManager#createMessageare covered byChannelMessageManagerandMessageManager; confirm the typings match.
Proposal
Work the list in this order, one PR per group, each with tests and a changeset (feat(plugin-gateway)):
- Access paths and small methods (sections 3 and 4, without the application parts):
guild.members,guild.roles,guild.presences,guild.voiceStates,category.children,answer.voters, and the missing methods. No new REST surface, so this can ship first. - Application layer: plugin-gateway: add ClientApplication and client.application (discord.js parity) #208, then plugin-gateway: port ApplicationEmoji (with its manager) and ApplicationCommand (discord.js parity) #207 and plugin-gateway: port ApplicationCommandManager and ApplicationCommandPermissionsManager (discord.js parity) #209.
- Monetization managers (section 2) once
ClientApplicationexists. - Verification pass (section 5), turning any finding into a fix or a documented difference.
Questions
- Entitlements and subscriptions change over gateway events (
ENTITLEMENT_CREATE/UPDATE/DELETE,SUBSCRIPTION_*). Cached with event-driven updates, or fetch-only like the application emojis question in plugin-gateway: port ApplicationEmoji (with its manager) and ApplicationCommand (discord.js parity) #207? - Should
guild.membersandguild.rolesstay thin scoped views over the client managers (likeguild.emojis), or become distinct manager instances with their owncacheConstructor/cacheOptions, as in discord.js?
Out of scope
- Interaction structures and their resolvers, builders, and collectors, which
@wolfstar/http-frameworkand@discordjs/buildersalready own. - Signature-level parity of the cache API; the pluggable cache keeps
Awaitablewhere discord.js is synchronous. - Event coverage for the new entities beyond what each manager needs to stay fresh.
Activity
pullfrog commentedon Oct 6, 2026
Assessment
The issue is actionable. I checked its claims against
packages/plugin-gateway/srcand the existing specs. The gap list is mostly accurate, with a few details to correct before planning PRs.Verified against the code
Guildhas scoped getters foremojis,stickers,channels,invites,bans,integrations,scheduledEvents,stageInstances,soundboardSoundsandautoModerationRules. It has none formembers,roles,presencesorvoiceStates.GatewayClienthasmembers,roles,presencesandvoiceStatesas readonly fields, and they are composite-keyed (resolveKey(guildId, id)). That is different fromguild.emojis, which uses a per-guild manager that shares the cache.category.childrenis missing.CategoryChannelis a mixin composition with no children manager.PollAnswerVoterManageris missing. Voters are reachable only viaMessageManager#fetchPollAnswerVotersandPollAnswer#fetchVoters.fetchSoundboardSounds(guildIds),channelCountWithoutThreads,rawFetchGuildActiveThreads,GuildEmojiManager#resolveIdentifier, orDataManager#valueOf.Entitlement,Subscription,SKU,ClientApplication).Corrections to the issue
widgetImageURLis trivial.Widget#imageURL(style = Shield)already exists instructures/guilds/Widget.ts.GuildManager#widgetImageURL(guild, style?)is only a URL builder overRoutes.guildWidgetImage, with no REST call.DataManager#valueOfis not missing.Structure#valueOfexists, but the managers have novalueOf, so the gap is real for managers. discord.js returns the manager's cache.ChannelThreadManager#createdoes branch onmessage. It creates a forum post whenmessageis set and a plain thread otherwise, so section 5's first check is only partly open. The remaining question is whether forum-only options (message,appliedTags) are rejected on text channels. TodayappliedTagsis silently ignored withoutmessage, andtype/invitableare ignored with it. There is no per-channel-type validation.fetchSoundboardSounds(guildIds)needs a new gateway opcode. This is opcode 31,REQUEST_SOUNDBOARD_SOUNDS. It replies via theSoundboardSoundsdispatch, which already exists inutil/dispatch.ts. So it is not a small method: it follows theGuildMemberManager#requesttemplate (shard id from the guild id, send, timeout after send, settle from the dispatch). It does not belong in the "no new REST surface" PR.Answers to the issue's open questions
guild.membersandguild.roles: thin scoped views or distinct managers? I recommend thin scoped views, likeguild.emojisandguild.channels.manager.cacheper entity, memoized inGatewayClient.CacheConstructor. A distinct manager with its owncacheConstructorandcacheOptionswould split that cache and break the sweepers andclient.cache.guildIdpre-filled, build a new instance per access, and exposecacheas a guild-filtered view.cacheOptionsstay out of scope.ENTITLEMENT_CREATE/UPDATE/DELETEcarry full payloads, which makes them cheap to cache.Subscriptionevents (SUBSCRIPTION_*) are not yet in thediscord-api-typesversion this repo uses, so they should be verified first; if absent, subscriptions stay fetch-only.MemoryEntityCache-style unmanaged store, as the learnings note forentitlementsandsubscriptions, plusplugin-cacheoperations and aplugin-cachechangeset.beforeneedDispatchStateCodecsentries.Proposed PR sequence
Each PR needs tests, a changeset, and a
feat(plugin-gateway): ...title. They follow the issue's order, with PR 1 split in two because of the opcode finding.guild.members,guild.roles,guild.presencesandguild.voiceStates, asGuildMemberManager-style scoped classes withguildIdpre-filled.DataManager#valueOf,GuildEmojiManager#resolveIdentifier,GuildManager#widgetImageURL, andGuildChannelManager#channelCountWithoutThreads(synchronous count over a cached channel list, with aCacheReadtwin).rawFetchGuildActiveThreadsonly if it has a consumer, becauseChannelThreadManager#fetchActivealready covers the public part.category.childrenandanswer.voters.CategoryChannelChildManager(cache,guild,create()withparent_idinjected) as a getter onCategoryChannel.PollAnswerVoterManager#fetchdelegating toMessageManager#fetchPollAnswerVoters, exposed asanswer.voters. The existingPollAnswer#fetchVotersstays.GuildManager#fetchSoundboardSounds(guildIds). This is the opcode 31 request, following theGuildMemberManager#requesttemplate, with new errors inerrors/Messages.tsandutil/errors.ts.ClientApplication,client.application), then plugin-gateway: port ApplicationEmoji (with its manager) and ApplicationCommand (discord.js parity) #207 and plugin-gateway: port ApplicationCommandManager and ApplicationCommandPermissionsManager (discord.js parity) #209. These are already scoped on their own issues.Entitlement,SubscriptionandSKUstructures,EntitlementManagerandSubscriptionManager, hung offclient.application.entitlementsandsku.subscriptions. This is blocked on plugin-gateway: add ClientApplication and client.application (discord.js parity) #208.ThreadManager#create, or typed overloads. Keeping one shared class and documenting the difference is the cheaper option.ChannelMessageManager, with tests on DM channels.crosspostandcreateMessage.Suggestions
docs/superpowers/specs/for PR 1 (the scoped-view decision), since2026-10-01-manager-api-parity-design.mdpredates themanager.cachearchitecture.@wolfstar/http-frameworkand@discordjs/builders.guild.commandsstays with plugin-gateway: port ApplicationCommandManager and ApplicationCommandPermissionsManager (discord.js parity) #209.I haven't started any implementation. When you want to start,
/implement-issuehandles PR 1 once the scoped-view decision is confirmed.claude-sonnet-5-5| 𝕏