Sever
Sever
DIAdiscord.js - Imagine an app
Created by Sever on 10/3/2024 in #djs-questions
Incompatible embeds
Hey, i need to copy my previous embed, but when im try to do this typescript give me error:
Argument of type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/discord.js/node_modules/discord-api-types/payloads/v10/channel").APIEmbed' is not assignable to parameter of type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/@discordjs/builders/node_modules/discord-api-types/payloads/v10/channel").APIEmbed'.
Types of property 'type' are incompatible.
Type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/discord.js/node_modules/discord-api-types/payloads/v10/channel").EmbedType | undefined' is not assignable to type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/@discordjs/builders/node_modules/discord-api-types/payloads/v10/channel").EmbedType | undefined'.
Type 'EmbedType.Rich' is not assignable to type 'EmbedType | undefined'.ts(2345)
Argument of type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/discord.js/node_modules/discord-api-types/payloads/v10/channel").APIEmbed' is not assignable to parameter of type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/@discordjs/builders/node_modules/discord-api-types/payloads/v10/channel").APIEmbed'.
Types of property 'type' are incompatible.
Type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/discord.js/node_modules/discord-api-types/payloads/v10/channel").EmbedType | undefined' is not assignable to type 'import("c:/Users/nikit/Desktop/Projects/New Fraction Bot/node_modules/@discordjs/builders/node_modules/discord-api-types/payloads/v10/channel").EmbedType | undefined'.
Type 'EmbedType.Rich' is not assignable to type 'EmbedType | undefined'.ts(2345)
The code:
const newEmbed = new EmbedBuilder(interaction.message.embeds[0].toJSON())
const newEmbed = new EmbedBuilder(interaction.message.embeds[0].toJSON())
Im using the latest version of discord.js (14.16.3) and @discordjs/builders (1.9.0)
2 replies