Repository navigation
feat(plugin-gateway): add discord.js Resolvable types - #154
Merged
Merged
Conversation
Adds every *Resolvable type from discord.js mapped onto the package's structures, the guild/text/voice/thread channel groups, Colors and resolveColor, and ApplicationFlagsBitField.
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the full diff (6 files, 1 commit) adding discord.js-style *Resolvable types to plugin-gateway.
util/resolvables.ts(new): every channel/guild/user/message/permission/application*Resolvabletype from discord.js'stypings/index.d.ts, mapped onto this package's own structures instead of discord.js's.- New channel groups:
ThreadChannel,GuildBasedChannel,NonThreadGuildBasedChannel,TextBasedChannel,VoiceBasedChannel,GuildInvitableChannel, listed by hand rather than derived fromAnyChannel(whoseBaseChannelfallback would structurally accept DM channels too). Colors/resolveColor(): ported runtime helper, with unit tests covering hex (with/without#), named colors, RGB-tuple packing,"Random", and theTypeError/RangeErrorpaths.ApplicationFlagsBitField(util/flags.ts): the one flags bitfield that was missing, following the existingNumberFlagsBitFieldpattern used by every sibling bitfield in that file.tests/types/resolvables.ts: type-level consumption test (wired into the package's existingtsconfig.consumption.json, so it runs under the rootpnpm typecheck) asserting DM channels and threads are correctly rejected by the guild-channel resolvables.index.ts: re-exports the new module.
Spot-checked several of the ported types (ColorResolvable, Colors, GuildResolvable, UserResolvable) against current discord.js source/docs — all matched exactly. Confirmed the hand-listed channel groups enumerate exactly the concrete channel structures under src/structures/channels/, and that there are no export name collisions with existing code. The PR explicitly and reasonably defers rewiring managers (which still take IdResolvable) to a follow-up rather than changing call signatures here.
Claude Sonnet | 𝕏
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

🧭 Context
Code ported from discord.js keeps reaching for
UserResolvable,ChannelResolvable,ColorResolvableand friends, and the gateway only had the flags ones plus a genericIdResolvable.📚 Description
Adds the full set of
*Resolvabletypes from discord.js'stypings/index.d.ts, pointing at our structures instead of theirs. The ones we already had (BitFieldResolvable, the flags ones,PermissionResolvable,BufferResolvable,EmojiIdentifierResolvable) stay where they are.Key changes
src/types.ts: every channel, guild, user, message, permission and application resolvable, plusColorResolvable,DateResolvableandRoleColorsResolvableThreadChannel,GuildBasedChannel,NonThreadGuildBasedChannel,TextBasedChannel,VoiceBasedChannel,GuildInvitableChannelColorsinutil/Colors.tsandresolveColor()inutil/Util.ts, same split as discord.js'ssrc/util, soColorResolvableis actually usableApplicationFlagsBitField, the one flags bitfield that was missingThings worth a look:
AnyChanneldoesn't work because itsBaseChannelfallback structurally accepts aDMChannel, soGuildChannelResolvablehappily took DMs.discord-api-typesshapes.IdResolvableand plainnumbercolors. I left rewiring them (e.g.RoleManageracceptingColorResolvable) for a follow-up rather than changing signatures in the same PR. Happy to fold it in if you'd prefer.Type of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.