diff --git a/library/core/components/embed.tsx b/library/core/components/embed.tsx index f957f53..260a5f9 100644 --- a/library/core/components/embed.tsx +++ b/library/core/components/embed.tsx @@ -4,6 +4,7 @@ import { omit } from "../../../helpers/omit" import { ReacordElement } from "../../internal/element.js" import type { MessageOptions } from "../../internal/message" import { Node } from "../../internal/node.js" +import { TextNode } from "../../internal/text-node" import { EmbedChildNode } from "./embed-child.js" import type { EmbedOptions } from "./embed-options" @@ -43,6 +44,9 @@ class EmbedNode extends Node { if (child instanceof EmbedChildNode) { child.modifyEmbedOptions(embed) } + if (child instanceof TextNode) { + embed.description = (embed.description || "") + child.props + } } options.embeds.push(embed) diff --git a/test/embed.test.tsx b/test/embed.test.tsx index 9441532..149fa69 100644 --- a/test/embed.test.tsx +++ b/test/embed.test.tsx @@ -7,15 +7,9 @@ import { EmbedImage, EmbedThumbnail, EmbedTitle, - Reacord, } from "../library/main" -import { TestAdapter, TestCommandInteraction } from "../library/testing" import { setupReacordTesting } from "./setup-testing" -const adapter = new TestAdapter() -const reacord = new Reacord({ adapter }) -const reply = reacord.createCommandReply(new TestCommandInteraction(adapter)) - const { assertRender } = setupReacordTesting() test("kitchen sink", async () => { @@ -44,6 +38,7 @@ test("kitchen sink", async () => { content: "", embeds: [ { + description: "description text", author: { icon_url: "https://example.com/author.png", name: "author",