componentsV2Message
componentsV2Message<
T>(components,options?):object&T
Defined in: packages/builders/src/components.ts:776
A message payload laid out with Components V2: the components, and the flag
Discord requires for them. A V2 message cannot also carry content or embeds.
Type Parameters
Section titled “Type Parameters”T extends Record<string, unknown> = Record<string, never>
Parameters
Section titled “Parameters”components
Section titled “components”{ toJSON: APIComponent; } | object[]
Top-level components (containers, sections, text displays, action rows…).
options?
Section titled “options?”T & object
Extra message fields, such as allowed_mentions or ephemeral; flags are combined.
Returns
Section titled “Returns”object & T
Example
Section titled “Example”channel.send(componentsV2Message(new CreateContainer().addComponents(new CreateTextDisplay().setContent("Hi"))))