embed: exclude children from embed options
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from "react"
|
||||
import { ReacordElement } from "../element.js"
|
||||
import { omit } from "../helpers/omit"
|
||||
import type { MessageOptions } from "../message"
|
||||
import { Node } from "../node.js"
|
||||
import { EmbedChildNode } from "./embed-child.js"
|
||||
@@ -37,7 +38,7 @@ export function Embed(props: EmbedProps) {
|
||||
|
||||
class EmbedNode extends Node<EmbedProps> {
|
||||
override modifyMessageOptions(options: MessageOptions): void {
|
||||
const embed = { ...this.props }
|
||||
const embed = omit(this.props, ["children"])
|
||||
for (const child of this.children) {
|
||||
if (child instanceof EmbedChildNode) {
|
||||
child.modifyEmbedOptions(embed)
|
||||
|
||||
Reference in New Issue
Block a user