Skip to content

feat(plugin-gateway): add ChannelManager#createMessage and resolve crosspost messages - #255

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
feat/plugin-gateway-crosspost-create-message
Oct 17, 2026
Merged

kodiakhq[bot] merged 1 commit into
mainfrom
feat/plugin-gateway-crosspost-create-message

Conversation

@RedStar071

Copy link
Copy Markdown
Member

🔗 Linked issue

Refs #216 (follow-up of the verification pass, #254).

🧭 Context

#254 documented two typing differences with discord.js instead of changing them: crosspost took a message ID where discord.js takes a MessageResolvable, and there was no ChannelManager#createMessage. The maintainer asked for both to match discord.js.

📚 Description

  • ChannelMessageManager#crosspost takes a MessageResolvable (a message or its ID), like GuildMessageManager#crosspost. It throws IdUnresolvable when the value holds no ID. client.messages.crosspost(channelId, messageId) keeps taking IDs, like the rest of that manager.
  • ChannelManager#createMessage(channel, options) takes a TextBasedChannelResolvable and the usual message options, and sends through client.messages.send, so it shares its payload, file and cache handling.
  • The README paragraph that listed these as differences now describes the new behaviour.

JSONEncodable and FileBodyEncodable bodies are still not accepted by message options: that is a wider difference than these two methods and is left as is.

Key changes

Change Before After
channel.messages.crosspost(x) x: string x: MessageResolvable
client.channels.createMessage(channel, options) missing TextBasedChannelResolvable + message options

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: Claude Code was used on this PR. Code written with claude-sonnet-5-5; PR description written with claude-sonnet-5-5. AI policy.

@coldtea-pr-lens

coldtea-pr-lens Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Architecture

Architecture diagram for wolfstar-project/plugins at dcd4a06

Play the walkthrough


Data flow

Data flow diagram for wolfstar-project/plugins at dcd4a06

Follow each request


Review

✨ Nothing flagged · reviewed dcd4a06


Tip

Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • After a push, tick Redraw to draw the latest commit
  • Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out on X, Bluesky, Mastodon, Reddit or LinkedIn

@wolfstarbot wolfstarbot added the packages:plugin-gateway Changes in plugin-gateway label Oct 17, 2026

@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 — the full single-commit diff, plus the surrounding resolveId, MessageManager#send/crosspost and type definitions; dm-messages.test.ts passes locally.

  • ChannelMessageManager#crosspost now takes a MessageResolvable and resolves it with resolveId, throwing IdUnresolvable when no ID is held. The assertGuild check still runs first, so DMs are refused before any ID handling.
  • ChannelManager#createMessage is new. It accepts a TextBasedChannelResolvable plus the usual message options and delegates to client.messages.send, so payload, file and cache handling stay shared.
  • Tests and docs: runtime tests cover crosspost by structure and createMessage by ID and by structure. Type tests cover both new signatures and their rejections. The README paragraph and a minor changeset are updated.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

@kodiakhq
kodiakhq Bot merged commit 1ca7f9e into main Oct 17, 2026
18 checks passed
@kodiakhq
kodiakhq Bot deleted the feat/plugin-gateway-crosspost-create-message branch October 17, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages:plugin-gateway Changes in plugin-gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants