Skip to content
Advertisement

Remove 1 element from Embed object DiscordJS

I have been trying to code a bot that copies 1 embed from 1 channel to another channel.

But what I want it to do before posting it to the other channel, I want it to remove 1 element from the embed object.

How I have it currently:

JavaScript

As you can see i straight use message.embeds[0].

So i don’t even know if it possible to remove 1 element from it like the footer text for example.

If anyone knows if it can be done or not, please say so.

Thank you for reading.

EDIT:

Would it be something like:

JavaScript

Advertisement

Answer

You can use the delete operator to remove a property from an object.

JavaScript

Note that you can’t remove only the text property and keep the icon. The footer won’t show without a text property.

enter image description here

These work too:

JavaScript
Advertisement