use adapter to make discord.js optional

This commit is contained in:
MapleLeaf
2021-12-25 20:05:35 -06:00
parent 4cf9049496
commit 6909336cac
18 changed files with 282 additions and 125 deletions

View File

@@ -1,7 +1,7 @@
import type { MessageEmbedOptions } from "discord.js"
import React from "react"
import { ReacordElement } from "../element.js"
import { EmbedChildNode } from "./embed-child.js"
import type { EmbedOptions } from "./embed-options"
export type EmbedTitleProps = {
children: string
@@ -18,7 +18,7 @@ export function EmbedTitle(props: EmbedTitleProps) {
}
class EmbedTitleNode extends EmbedChildNode<EmbedTitleProps> {
override modifyEmbedOptions(options: MessageEmbedOptions): void {
override modifyEmbedOptions(options: EmbedOptions): void {
options.title = this.props.children
options.url = this.props.url
}