Class DiscordInteractionModalBuilder
Constructs an interaction modal response.
Inheritance
Namespace: DisCatSharp.Entities
Assembly: DisCatSharp.dll
Syntax
public sealed class DiscordInteractionModalBuilder
Constructors
| Improve this Doc View SourceDiscordInteractionModalBuilder(String, String)
Constructs a new empty interaction modal builder.
Declaration
public DiscordInteractionModalBuilder(string title = null, string customId = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | |
System.String | customId |
Properties
| Improve this Doc View SourceCustomId
Custom id of modal.
Declaration
public string CustomId { get; set; }
Property Value
Type | Description |
---|---|
System.String |
ModalComponents
Components to send on this interaction response.
Declaration
public IReadOnlyList<DiscordActionRowComponent> ModalComponents { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<DiscordActionRowComponent> |
Title
Title of modal.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceAddModalComponents(DiscordComponent[])
Appends a collection of components to the builder.
Declaration
public DiscordInteractionModalBuilder AddModalComponents(params DiscordComponent[] components)
Parameters
Type | Name | Description |
---|---|---|
DiscordComponent[] | components | The components to append. Up to five. |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder | The current builder to chain calls with. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when passing more than 5 components. |
AddModalComponents(IEnumerable<DiscordActionRowComponent>)
Appends several rows of components to the message
Declaration
public DiscordInteractionModalBuilder AddModalComponents(IEnumerable<DiscordActionRowComponent> components)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<DiscordActionRowComponent> | components | The rows of components to add, holding up to five each. |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder | The current builder to chain calls with. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when passing more than 5 components. |
AddSelectComponent(DiscordSelectComponent)
Appends a select component to the builder.
Declaration
public DiscordInteractionModalBuilder AddSelectComponent(DiscordSelectComponent component)
Parameters
Type | Name | Description |
---|---|---|
DiscordSelectComponent | component | The component to append. |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder | The current builder to chain calls with. |
AddSelectComponents(DiscordSelectComponent[])
Appends a collection of select components to the builder. Each call will append to a new row.
Declaration
public DiscordInteractionModalBuilder AddSelectComponents(params DiscordSelectComponent[] components)
Parameters
Type | Name | Description |
---|---|---|
DiscordSelectComponent[] | components | The components to append. Up to five. |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder | The current builder to chain calls with. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when passing more than 5 components. |
AddTextComponent(DiscordTextComponent)
Appends a text component to the builder.
Declaration
public DiscordInteractionModalBuilder AddTextComponent(DiscordTextComponent component)
Parameters
Type | Name | Description |
---|---|---|
DiscordTextComponent | component | The component to append. |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder | The current builder to chain calls with. |
AddTextComponents(DiscordTextComponent[])
Appends a collection of text components to the builder. Each call will append to a new row.
Declaration
public DiscordInteractionModalBuilder AddTextComponents(params DiscordTextComponent[] components)
Parameters
Type | Name | Description |
---|---|---|
DiscordTextComponent[] | components | The components to append. Up to five. |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder | The current builder to chain calls with. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when passing more than 5 components. |
Clear()
Allows for clearing the Interaction Response Builder so that it can be used again to send a new response.
Declaration
public void Clear()
ClearComponents()
Clears all message components on this builder.
Declaration
public void ClearComponents()
WithCustomId(String)
Declaration
public DiscordInteractionModalBuilder WithCustomId(string customId)
Parameters
Type | Name | Description |
---|---|---|
System.String | customId |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder |
WithTitle(String)
Declaration
public DiscordInteractionModalBuilder WithTitle(string title)
Parameters
Type | Name | Description |
---|---|---|
System.String | title |
Returns
Type | Description |
---|---|
DiscordInteractionModalBuilder |