Repository navigation
feat(plugin-gateway): add ChannelManager#createMessage and resolve crosspost messages - #255
Merged
Conversation
|
Architecture Data flow Review ✨ Nothing flagged · reviewed Tip Add 🪧 More tips
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 |
Contributor
There was a problem hiding this comment.
✅ 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#crosspostnow takes aMessageResolvableand resolves it withresolveId, throwingIdUnresolvablewhen no ID is held. TheassertGuildcheck still runs first, so DMs are refused before any ID handling.ChannelManager#createMessageis new. It accepts aTextBasedChannelResolvableplus the usual message options and delegates toclient.messages.send, so payload, file and cache handling stay shared.- Tests and docs: runtime tests cover crosspost by structure and
createMessageby ID and by structure. Type tests cover both new signatures and their rejections. The README paragraph and a minor changeset are updated.
claude-sonnet-5-5 | 𝕏
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
Refs #216 (follow-up of the verification pass, #254).
🧭 Context
#254 documented two typing differences with discord.js instead of changing them:
crossposttook a message ID where discord.js takes aMessageResolvable, and there was noChannelManager#createMessage. The maintainer asked for both to match discord.js.📚 Description
ChannelMessageManager#crossposttakes aMessageResolvable(a message or its ID), likeGuildMessageManager#crosspost. It throwsIdUnresolvablewhen the value holds no ID.client.messages.crosspost(channelId, messageId)keeps taking IDs, like the rest of that manager.ChannelManager#createMessage(channel, options)takes aTextBasedChannelResolvableand the usual message options, and sends throughclient.messages.send, so it shares its payload, file and cache handling.JSONEncodableandFileBodyEncodablebodies are still not accepted by message options: that is a wider difference than these two methods and is left as is.Key changes
channel.messages.crosspost(x)x: stringx: MessageResolvableclient.channels.createMessage(channel, options)TextBasedChannelResolvable+ message optionsType of Change
Pre-flight Checklist
pnpm changeset(orpnpm changeset add --emptyif no release is needed). See .changeset/README.md.