Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add ChannelManager#createMessage() #10559

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TAEMBO
Copy link
Contributor

@TAEMBO TAEMBO commented Oct 16, 2024

Please describe the changes this PR makes and why it should be merged:
Moves the sending of messages from individual channels to ChannelManager.

BREAKING CHANGE: MessageCreateOptions no longer accepts reply. Use messageReference instead.
BREAKING CHANGE: TextBasedChannel#send() has been removed. Use ChannelManager#createMessage() instead.
BREAKING CHANGE: Message#reply() has been removed. Use ChannelManager#createMessage() instead.
BREAKING CHANGE: BaseChannel#isSendable() has been removed.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@TAEMBO TAEMBO requested a review from a team as a code owner October 16, 2024 06:38
Copy link

vercel bot commented Oct 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Dec 5, 2024 9:38pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Dec 5, 2024 9:38pm

@almostSouji

This comment was marked as outdated.

Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

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

This is missing an implementation in send(). Just like reply is an option there, there should be a forward option.

Although, now that both reply and forward is there, maybe both should be removed in favour of messageReference so we don't have to keep adding new message reference types (and thus new properties).

packages/discord.js/src/structures/Message.js Outdated Show resolved Hide resolved
@Jiralite Jiralite added this to the discord.js 14.17 milestone Oct 16, 2024
@TAEMBO TAEMBO force-pushed the feat/forwarding-messages branch from a55e642 to 1156836 Compare October 17, 2024 03:39
@TAEMBO TAEMBO requested a review from Jiralite October 17, 2024 03:44
@TAEMBO TAEMBO force-pushed the feat/forwarding-messages branch 6 times, most recently from 7ae23ed to 6f08f65 Compare October 24, 2024 20:41
@TAEMBO TAEMBO changed the title feat: forwarding messages feat!: forwarding messages Oct 24, 2024
packages/discord.js/typings/index.d.ts Show resolved Hide resolved
@@ -4309,6 +4310,7 @@ export abstract class MessageManager<InGuild extends boolean = boolean> extends
public fetch(options: MessageResolvable | FetchMessageOptions): Promise<Message<InGuild>>;
public fetch(options?: FetchMessagesOptions): Promise<Collection<Snowflake, Message<InGuild>>>;
public fetchPinned(cache?: boolean): Promise<Collection<Snowflake, Message<InGuild>>>;
public forward(reference: Omit<MessageReference, 'type'>): Promise<Message<InGuild>>;
Copy link
Member

Choose a reason for hiding this comment

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

This feels out of place in the manager...

  • we don't have create
  • we don't have reply

So we should either move create/reply into this manager, or drop this from here altogether. And I'm leaning more towards the former.. thoughts @discordjs/core?

Copy link
Member

@Jiralite Jiralite Nov 4, 2024

Choose a reason for hiding this comment

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

If we were to move anything at all, it'd probably just be create() (replying and forwarding can happen within this method).

@TAEMBO TAEMBO force-pushed the feat/forwarding-messages branch from 6f08f65 to afbbc7d Compare November 29, 2024 17:55
@TAEMBO TAEMBO force-pushed the feat/forwarding-messages branch from 715fdbe to bf2ac31 Compare December 5, 2024 21:38
@TAEMBO TAEMBO changed the title feat!: forwarding messages feat!: add ChannelManager#createMessage() Dec 5, 2024
@TAEMBO TAEMBO requested a review from vladfrangu December 5, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

5 participants