Method AddComponents
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
AddComponents(params DiscordComponent[])
Adds a row of components to the builder, up to 5
components per row, and up to 5
rows per
message.
If WithV2Components() was called, the limit changes to 10
top-level components and max
30
components in total.
public DiscordInteractionResponseBuilder AddComponents(params DiscordComponent[] components)
Parameters
components
DiscordComponent[]The components to append. Up to five.
Returns
- DiscordInteractionResponseBuilder
The current builder to chain calls with.
AddComponents(params DiscordActionRowComponent[])
Appends several rows of components to the message
public DiscordInteractionResponseBuilder AddComponents(params DiscordActionRowComponent[] components)
Parameters
components
DiscordActionRowComponent[]The rows of components to add, holding up to five each.
Returns
- DiscordInteractionResponseBuilder
The builder to chain calls with.
Exceptions
- ArgumentOutOfRangeException
No components were passed.
AddComponents(IEnumerable<DiscordActionRowComponent>)
Appends several rows of components to the message
public DiscordInteractionResponseBuilder AddComponents(IEnumerable<DiscordActionRowComponent> components)
Parameters
components
IEnumerable<DiscordActionRowComponent>The rows of components to add, holding up to five each.
Returns
- DiscordInteractionResponseBuilder
The current builder to chain calls with.
Exceptions
- ArgumentException
Thrown when passing more than 5 components.
AddComponents(IEnumerable<DiscordComponent>)
Appends a collection of components to the builder. Each call will append to a new row.
public DiscordInteractionResponseBuilder AddComponents(IEnumerable<DiscordComponent> components)
Parameters
components
IEnumerable<DiscordComponent>The components to append. Up to five.
Returns
- DiscordInteractionResponseBuilder
The current builder to chain calls with.
Exceptions
- ArgumentException
Thrown when passing more than 5 components.