remove some random comments and unneeded stuff

This commit is contained in:
itsMapleLeaf
2022-08-04 14:37:54 -05:00
parent 2c8742bc5f
commit 843b4ef9db
4 changed files with 4 additions and 74 deletions

View File

@@ -39,43 +39,11 @@ export type ButtonClickEvent = ComponentEvent & {
export function Button(props: ButtonProps) {
return (
<ReacordElement props={props} createNode={() => new ButtonNode(props)}>
<ReacordElement props={{}} createNode={() => new ButtonLabelNode({})}>
{props.label}
</ReacordElement>
</ReacordElement>
)
}
export class ButtonNode extends Node<ButtonProps> {
readonly customId = randomUUID()
// this has text children, but buttons themselves shouldn't yield text
// eslint-disable-next-line class-methods-use-this
// override get text() {
// return ""
// }
// override modifyMessageOptions(options: MessageOptions): void {
// getNextActionRow(options).push({
// type: "button",
// customId: this.customId,
// style: this.props.style ?? "secondary",
// disabled: this.props.disabled,
// emoji: this.props.emoji,
// label: this.children.findType(ButtonLabelNode)?.text,
// })
// }
// override handleComponentInteraction(interaction: ComponentInteraction) {
// if (
// interaction.type === "button" &&
// interaction.customId === this.customId
// ) {
// this.props.onClick(interaction.event)
// return true
// }
// return false
// }
}
class ButtonLabelNode extends Node<{}> {}

View File

@@ -29,16 +29,6 @@ export function EmbedField(props: EmbedFieldProps) {
)
}
export class EmbedFieldNode extends Node<EmbedFieldProps> {
// override modifyEmbedOptions(options: EmbedOptions): void {
// options.fields ??= []
// options.fields.push({
// name: this.children.findType(FieldNameNode)?.text ?? "",
// value: this.children.findType(FieldValueNode)?.text ?? "",
// inline: this.props.inline,
// })
// }
}
export class EmbedFieldNode extends Node<EmbedFieldProps> {}
export class EmbedFieldNameNode extends Node<{}> {}
export class EmbedFieldValueNode extends Node<{}> {}

View File

@@ -26,14 +26,4 @@ export function EmbedFooter({ text, children, ...props }: EmbedFooterProps) {
export class EmbedFooterNode extends Node<
Omit<EmbedFooterProps, "text" | "children">
> {
// override modifyEmbedOptions(options: EmbedOptions): void {
// options.footer = {
// text: this.children.findType(FooterTextNode)?.text ?? "",
// icon_url: this.props.iconUrl,
// }
// options.timestamp = this.props.timestamp
// ? new Date(this.props.timestamp).toISOString()
// : undefined
// }
}
> {}

View File

@@ -33,22 +33,4 @@ export function Embed(props: EmbedProps) {
)
}
export class EmbedNode extends Node<EmbedProps> {
// override modifyMessageOptions(options: MessageOptions): void {
// const embed: EmbedOptions = {
// ...snakeCaseDeep(omit(this.props, ["children", "timestamp"])),
// timestamp: this.props.timestamp
// ? new Date(this.props.timestamp).toISOString()
// : undefined,
// }
// for (const child of this.children) {
// if (child instanceof EmbedChildNode) {
// child.modifyEmbedOptions(embed)
// }
// if (child instanceof TextNode) {
// embed.description = (embed.description || "") + child.props
// }
// }
// options.embeds.push(embed)
// }
}
export class EmbedNode extends Node<EmbedProps> {}