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 { ReacordElement } from "../../internal/element.js"
|
||||||
import type { MessageOptions } from "../../internal/message"
|
import type { MessageOptions } from "../../internal/message"
|
||||||
import { Node } from "../../internal/node.js"
|
import { Node } from "../../internal/node.js"
|
||||||
|
import { TextNode } from "../../internal/text-node"
|
||||||
import { EmbedChildNode } from "./embed-child.js"
|
import { EmbedChildNode } from "./embed-child.js"
|
||||||
import type { EmbedOptions } from "./embed-options"
|
import type { EmbedOptions } from "./embed-options"
|
||||||
|
|
||||||
@@ -43,6 +44,9 @@ class EmbedNode extends Node<EmbedProps> {
|
|||||||
if (child instanceof EmbedChildNode) {
|
if (child instanceof EmbedChildNode) {
|
||||||
child.modifyEmbedOptions(embed)
|
child.modifyEmbedOptions(embed)
|
||||||
}
|
}
|
||||||
|
if (child instanceof TextNode) {
|
||||||
|
embed.description = (embed.description || "") + child.props
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
options.embeds.push(embed)
|
options.embeds.push(embed)
|
||||||
|
|||||||
@@ -7,15 +7,9 @@ import {
|
|||||||
EmbedImage,
|
EmbedImage,
|
||||||
EmbedThumbnail,
|
EmbedThumbnail,
|
||||||
EmbedTitle,
|
EmbedTitle,
|
||||||
Reacord,
|
|
||||||
} from "../library/main"
|
} from "../library/main"
|
||||||
import { TestAdapter, TestCommandInteraction } from "../library/testing"
|
|
||||||
import { setupReacordTesting } from "./setup-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()
|
const { assertRender } = setupReacordTesting()
|
||||||
|
|
||||||
test("kitchen sink", async () => {
|
test("kitchen sink", async () => {
|
||||||
@@ -44,6 +38,7 @@ test("kitchen sink", async () => {
|
|||||||
content: "",
|
content: "",
|
||||||
embeds: [
|
embeds: [
|
||||||
{
|
{
|
||||||
|
description: "description text",
|
||||||
author: {
|
author: {
|
||||||
icon_url: "https://example.com/author.png",
|
icon_url: "https://example.com/author.png",
|
||||||
name: "author",
|
name: "author",
|
||||||
|
|||||||
Reference in New Issue
Block a user