Class InteractionResponseBuilder
Represents a builder class for creating IDiscordInteractionResponses.
Inheritance
Inherited Members
Namespace: Color_Chan.Discord.Commands.MessageBuilders
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public class InteractionResponseBuilder
Methods
| Improve this Doc View SourceBuild(Nullable<DiscordInteractionCallbackType>)
Builds a IDiscordInteractionResponse with all the set values.
Declaration
public IDiscordInteractionResponse Build(DiscordInteractionCallbackType? type = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<DiscordInteractionCallbackType> | type | The type of the response. |
Returns
Type | Description |
---|---|
IDiscordInteractionResponse | The build IDiscordInteractionResponse. |
EmptyComponents()
Sets the Color_Chan.Discord.Commands.MessageBuilders.InteractionResponseBuilder._components to an empty list of IDiscordComponents.
Declaration
public InteractionResponseBuilder EmptyComponents()
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
EmptyEmbeds()
Sets the Color_Chan.Discord.Commands.MessageBuilders.InteractionResponseBuilder._embeds to an empty list of IDiscordEmbeds.
Declaration
public InteractionResponseBuilder EmptyEmbeds()
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
EnableTts()
Enables Text To Speech for the response.
Declaration
public InteractionResponseBuilder EnableTts()
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
MakePrivate()
Makes the response only visible to the person that has used the slash command.
Declaration
public InteractionResponseBuilder MakePrivate()
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
WithAllowedMentions(IDiscordAllowedMentions)
Sets the allowed mentions for the response.
Declaration
public InteractionResponseBuilder WithAllowedMentions(IDiscordAllowedMentions allowedMentions)
Parameters
Type | Name | Description |
---|---|---|
IDiscordAllowedMentions | allowedMentions | The allowed mentions. |
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
WithComponent(IDiscordComponent)
Adds an component to the response.
Declaration
public InteractionResponseBuilder WithComponent(IDiscordComponent component)
Parameters
Type | Name | Description |
---|---|---|
IDiscordComponent | component | The new component. |
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the max component limit of 5 has been reached. |
WithContent(String)
Adds content to the response.
Declaration
public InteractionResponseBuilder WithContent(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | The content. |
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
WithEmbed(IDiscordEmbed)
Adds an embed to the response.
Declaration
public InteractionResponseBuilder WithEmbed(IDiscordEmbed embed)
Parameters
Type | Name | Description |
---|---|---|
IDiscordEmbed | embed | The embed that will be added. |
Returns
Type | Description |
---|---|
InteractionResponseBuilder | The updated InteractionResponseBuilder. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when the max embed limit of 10 has been reached. |