Repository navigation
fix(plugin-gateway): read the optional ids of a message as null like discord.js - #276
Merged
Merged
Conversation
|
Architecture Data flow No data-flow sequence changed in this PR. Tip The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
1 task done
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: the full diff of the single commit, with the structures test file run locally (24/24 pass).
Messagegetters —webhookId,applicationId,nonceandpositionnow return?? null, matching discord.js and the existingguildId/editedTimestampoverrides.- Base generic —
NullableMessageKeysis omitted fromBaseMessage<...>, which lets the overrides narrowstring | undefinedtostring | null(the base getter is typed againstOmitted, so this is the right lever). - Tests and changeset — covers both the absent case (
null) and the present case, includingposition: 0surviving as0rather than collapsing tonull; patch changeset for@wolfstar/plugin-gateway.
pnpm typecheck reports errors in this checkout, but they come from @wolfstar/plugin-cache not being built here, and none sit on the new lines.
claude-sonnet-5-5 | 𝕏
1 task done
This was referenced Nov 3, 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.

🔗 Linked issue
Related to wolfstar-project/wolfstar#357
🧭 Context
The honeypot of Wolfstar caught nobody on staging. The bot skips webhooks with
message.webhookId !== null, as it did with discord.js, but ourMessageinheritswebhookIdfrom@discordjs/structures, which givesundefinedwhen there is no webhook. Every message read as a webhook's, so the bot ignored all of them since it moved to the gateway plugin.📚 Description
Messagealready mirrors discord.js where it overrides a getter (guildId,editedTimestamparenullwhen absent), butwebhookId,applicationId,nonceandpositioncame straight from the base class. They arenullnow when the message has none, the same as in discord.js.Not sure this is the full list: I only looked at the getters of
Messagethat are not overridden. Other structures may inherit the sameundefinedfrom@discordjs/structures, I did not go through them.Key changes
Message#webhookIdundefinednullMessage#applicationIdundefinednullMessage#nonceundefinednullMessage#positionundefinednullThe four keys are omitted from the type of the base class (
BaseMessage<"webhook_id" | ...>), asMessageReactiondoes for its counts, since an override cannot narrowstring | undefinedtostring | null.Type of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.