Skip to content

feat: bring gateway messages, reactions and polls to discord.js parity - #101

Merged
RedStar071 merged 2 commits into
feat/guild-assetsfrom
feat/messages
Sep 25, 2026
Merged

RedStar071 merged 2 commits into
feat/guild-assetsfrom
feat/messages

Conversation

@RedStar071

@RedStar071 RedStar071 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Stacked on #98.

🔗 Linked issue

Related to #54 (phase 7a of the roadmap).

🧭 Context

Message only exposed raw attachments and embeds and a list of mentioned users, and the only message route was fetch. Replying, reacting, pinning or sending to a channel meant going through raw REST calls.

📚 Description

Messages now follow discord.js. Attachments, embeds, mentions, reactions and polls get their own structures, and Message gains discord.js's actions: reply, edit, delete, forward, pin/unpin, react, crosspost, startThread, suppressEmbeds and removeAttachments. client.messages now covers every message and reaction route (list, send, bulk delete, pins, crosspost, poll end and voters). Text channels get messages, send, sendTyping, bulkDelete and fetchLastMessage.

Things worth reviewing:

  • Changed getters. message.mentions is now a MessageMentions instead of User[], and attachments/embeds return structures instead of raw objects. The package isn't released yet, so I changed them in place instead of keeping the old shapes around.
  • Async relations. discord.js reads channel, guild and deletable & co. synchronously from its cache. Here they are fetchChannel, fetchGuild, fetchReference and fetchDeletable/fetchEditable/fetchPinnable/fetchCrosspostable/fetchBulkDeletable. These checks use guild-wide permissions for now. Channel overwrites come in phase 8.
  • Reactions are a snapshot. message.reactions reads the reactions in the message payload. The gateway reaction events don't update the cached message yet. That's phase 7b, which needs a new cache operation in plugin-cache.
  • cleanContent only replaces user mentions, using the names in the payload, and defuses @everyone/@here. Role and channel names would need the async cache, so those mentions are left as they are.

Key changes

Area Change
Structures Attachment, Embed, MessageMentions, MessageReaction, Poll, PollAnswer, ReactionEmoji
Message All fields (flags, poll, reactions, thread, messageSnapshots, cleanContent, ...), the actions listed above, fetch* relations, equals
Managers MessageManager routes, ChannelMessageManager, ReactionManager, ReactionUserManager
Text channels messages, send, sendTyping, bulkDelete, fetchLastMessage

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation change
  • Workflow / CI change

Pre-flight Checklist

  • I have read the Contributing Guidelines (if applicable)
  • My code follows the code style of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • I added a changeset with pnpm changeset (or pnpm changeset add --empty if no release is needed). See .changeset/README.md.

🤖 AI disclosure: Wolfstar Agent Kit modified this description. My AI open-source policy.

@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

◈ PR Lens

PR Lens paused analysis for this repository — the fair-use limit was reached. It resumes automatically at 2026-09-25T18:00:00.000Z.

@RedStar071
RedStar071 added this pull request to stack #96 September 24, 2026 16:59

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

One method's implementation doesn't match its own documented contract — see below.

Reviewed changes

Reviewed the full diff (20 files) bringing gateway messages, reactions, and polls to discord.js parity.

  • New structures: Attachment, Embed, MessageMentions, MessageReaction, Poll, PollAnswer, ReactionEmoji — thin wrappers over API payload slices, consistent with the existing Structure<T> pattern.
  • Message additions: new fields/getters (flags, poll, reactions, thread, messageSnapshots, cleanContent, system, ...), actions (reply, edit, delete, forward, pin/unpin, react, crosspost, startThread, suppressEmbeds, removeAttachments, equals), and async relation/permission checks (fetchChannel, fetchGuild, fetchReference, fetchEditable/fetchDeletable/fetchBulkDeletable/fetchPinnable/fetchCrosspostable).
  • New managers: MessageManager gains the full message/reaction/poll REST surface; ReactionManager (a message-payload snapshot, explicitly documented as not gateway-updated yet) and ReactionUserManager (paginated reactors); ChannelMessageManager as a channel-scoped facade over client.messages.
  • TextChannelMixin: messages, send, sendTyping, bulkDelete, fetchLastMessage.
  • Breaking, in-place changes (package unreleased, acknowledged in the PR description): message.mentions is now MessageMentions instead of User[]; attachments/embeds return structures instead of raw payload objects.

I verified the new Routes.* calls, permission strings, and bit-field usage against the vendored discord-api-types and existing codebase patterns — all check out (routes exist with matching arities, PinMessages/ManageMessages are valid PermissionFlagsBits keys, .bitField access matches GuildMember.ts/User.ts).

ℹ️ Nitpicks

  • MessageReaction.fetch() (src/structures/MessageReaction.ts) resets count/me to 0/false when the reaction is fully gone, but leaves countDetails, meBurst, and burstColors stale from before the fetch.
  • ChannelMessageManager exposes crosspost/pin/unpin but not react/startThread/removeAllReactions/endPoll, despite its doc comment describing it as "client.messages, with the channel's ID filled in." Worth a deliberate scope call rather than an accidental gap.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using Claude Sonnet | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@wolfstar/plugin-api

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-api@101

@wolfstar/plugin-cache

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-cache@101

@wolfstar/plugin-gateway

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-gateway@101

@wolfstar/plugin-i18next

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-i18next@101

@wolfstar/plugin-logger

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-logger@101

@wolfstar/plugin-subcommands-advanced

pnpm add https://pkg.pr.new/wolfstar-project/plugins/@wolfstar/plugin-subcommands-advanced@101

commit: 2dbc549

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior Pullfrog review (1d4d859 → f552acc), a single fix commit resolving every item raised in round 1.

  • Fixed fetchCrosspostable() — now fetches the channel and requires channel.type === ChannelType.GuildAnnouncement before returning true, matching its own docstring. Two new tests cover both branches.
  • Fixed stale reaction fields on full removal — MessageReaction.fetch() now resets count_details, me_burst, and burst_colors alongside count/me when the reaction is gone, instead of leaving them stale.
  • Filled out ChannelMessageManager's route surface — added bulkDelete, forward, react, removeReactionEmoji, removeAllReactions, startThread, endPoll, and fetchPollAnswerVoters as thin delegations to client.messages.*, closing the gap between its doc comment ("client.messages, with the channel's ID filled in") and its actual coverage.

I verified each new ChannelMessageManager method's parameter order and types against the corresponding MessageManager method it delegates to — all consistent — and confirmed ChannelType.GuildAnnouncement (value 5) is correct against the vendored [email protected] payload types.

Pullfrog  | View workflow run | Using Claude Sonnet | 𝕏

@pullfrog

pullfrog Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Your Claude subscription has hit its usage limit. It resets at 7:20pm (UTC). Re-trigger Pullfrog after the reset, or add an ANTHROPIC_API_KEY repo secret — Pullfrog routes around an exhausted subscription automatically when one is present.

Add repo secret → · Model settings → · Setup docs → · Ask in Discord →

Pullfrog  | Rerun failed job ➔ | View workflow run | via Pullfrog | Using Claude Sonnet | 𝕏

@RedStar071
RedStar071 merged commit 4c60620 into main Sep 25, 2026
18 of 25 checks passed
@RedStar071
RedStar071 deleted the feat/messages branch September 25, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant