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

SetID Method for EmbedBuilder #10050

Closed
wants to merge 2 commits into from
Closed

SetID Method for EmbedBuilder #10050

wants to merge 2 commits into from

Conversation

frezyn
Copy link

@frezyn frezyn commented Dec 14, 2023

Changes Made:

This Pull Request introduces a new feature to the EmbedBuilder in the Discord.js library. A setId method has been added, enabling the assignment of a unique identification ID to an embed. This feature is particularly useful for identifying and managing embeds more effectively in complex applications.

Reason for Merging:

The inclusion of the setId method enhances the capabilities of EmbedBuilder, providing developers with greater flexibility and control over the creation and management of embeds. This can be particularly beneficial in scenarios where multiple embeds are used and require individual identification.

Status and Versioning Classification:

Code changes have been tested against the Discord API.

Typings do not need updating or have been updated.
This PR includes changes to the library's interface (methods or parameters added).
There are no significant breaking changes (methods removed or renamed, parameters moved or removed).

Technical Details:

The main modification is in the setID method, which stores a user-provided ID within the EmbedBuilder object. This ID can later be used for referencing or manipulating the embed. Additionally, the toJSON method has been updated to include this new ID field when an embed is converted to JSON. This functionality does not alter the existing functionality of EmbedBuilder but adds a new capability.

Copy link

vercel bot commented Dec 14, 2023

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
discord-js ⬜️ Ignored (Inspect) Visit Preview Dec 14, 2023 8:10am
discord-js-guide ⬜️ Ignored (Inspect) Visit Preview Dec 14, 2023 8:10am

@Syjalo
Copy link
Contributor

Syjalo commented Dec 14, 2023

Just make an array of your embed ids and when you're done map it to your embeds. No need to add this to the library.

@Qjuh
Copy link
Contributor

Qjuh commented Dec 14, 2023

The EmbedBuilder is for building JSON of an embed that then can be sent to discord’s API. Your PR adds a property to that JSON that the API doesn’t expect/take. That alone makes your PR invalid here.

Even if it was a valid approach (which it is not) you use two different properties, one named _id and one named id which makes it clear you didn’t even test your PR.

Copy link
Member

@almostSouji almostSouji left a comment

Choose a reason for hiding this comment

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

nevermind, not considering the questionable use, this isn't even correct or, as qjuh pointed out already, tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants