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

Message embeds #1529

Merged
merged 17 commits into from
May 28, 2017
Merged

Message embeds #1529

merged 17 commits into from
May 28, 2017

Conversation

Drahcirius
Copy link
Member

Branch history continuing from #1345

message.channel.fetchMessage("318040520050081793").then(m => {
  const embed = m.embeds[0];
  embed.title = "New Title";
  m.edit({ embed });
});

The code above would give a Converting circular structure to JSON error when sending a changed message embed object. This patch allows for message embeds to be re-sent without getting these errors.

A more complete version of #1452 was also included in this patch, which makes this a breaking change because it removes the reference from the embed to the original message. This makes doing message.embeds[0].message no longer possible.

Credits to @devsnek for writing the initial embed transform code.

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

This was referenced May 27, 2017
@iCrawl iCrawl added this to the 12.0.0 milestone May 27, 2017
@iCrawl iCrawl merged commit 5553170 into discordjs:master May 28, 2017
Ratismal pushed a commit to Ratismal/discord.js that referenced this pull request Jul 5, 2017
* wowe

* fix sending

* Update MessageEmbed.js

* lel

* patched some fields for message embed and transforms edits as well

* webhook embeds transform

* apply transform to webhook embeds, and changed references

* Update MessageEmbed.js

* Update ClientDataResolver.js

* updated embeds params and use new util resolvers

* did not mean to add this back

* use master version of ClientDataResolver

* transform no longer needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants