fix embed description text
This commit is contained in:
@@ -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<EmbedProps> {
|
||||
if (child instanceof EmbedChildNode) {
|
||||
child.modifyEmbedOptions(embed)
|
||||
}
|
||||
if (child instanceof TextNode) {
|
||||
embed.description = (embed.description || "") + child.props
|
||||
}
|
||||
}
|
||||
|
||||
options.embeds.push(embed)
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user