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!: forwarding messages #10559

Open
wants to merge 1 commit 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:
Adds the ability to forward messages.

BREAKING CHANGE: MessageCreateOptions no longer accepts reply. Use messageReference instead.

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)

@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 Oct 24, 2024 8:41pm
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Oct 24, 2024 8:41pm

@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 requested a review from Jiralite October 17, 2024 03:44
@TAEMBO TAEMBO force-pushed the feat/forwarding-messages branch 5 times, most recently from 07a5c46 to 7ae23ed Compare October 23, 2024 00:29
@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).

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