select: always create new action row

This commit is contained in:
MapleLeaf
2021-12-27 02:31:48 -06:00
parent a4425ce923
commit ca00131f25

View File

@@ -4,8 +4,7 @@ import React from "react"
import { isInstanceOf } from "../../../helpers/is-instance-of" import { isInstanceOf } from "../../../helpers/is-instance-of"
import { ReacordElement } from "../../internal/element.js" import { ReacordElement } from "../../internal/element.js"
import type { ComponentInteraction } from "../../internal/interaction" import type { ComponentInteraction } from "../../internal/interaction"
import type { MessageOptions } from "../../internal/message" import type { ActionRow, MessageOptions } from "../../internal/message"
import { getNextActionRow } from "../../internal/message"
import { Node } from "../../internal/node.js" import { Node } from "../../internal/node.js"
import { OptionNode } from "./option-node" import { OptionNode } from "./option-node"
@@ -39,7 +38,8 @@ class SelectNode extends Node<SelectProps> {
readonly customId = nanoid() readonly customId = nanoid()
override modifyMessageOptions(message: MessageOptions): void { override modifyMessageOptions(message: MessageOptions): void {
const actionRow = getNextActionRow(message) const actionRow: ActionRow = []
message.actionRows.push(actionRow)
const options = [...this.children] const options = [...this.children]
.filter(isInstanceOf(OptionNode)) .filter(isInstanceOf(OptionNode))