Class InteractionModuleBase
The base of all interaction modules.
Inherited Members
Namespace: Color_Chan.Discord.Commands.Modules
Assembly: Color-Chan.Discord.Commands.dll
Syntax
public class InteractionModuleBase
Methods
| Improve this Doc View SourceFromError(ErrorResult)
Create a result object describing an error.
Declaration
protected static Result<IDiscordInteractionResponse> FromError(ErrorResult errorResult)
Parameters
Type | Name | Description |
---|---|---|
ErrorResult | errorResult | The ErrorResult containing the details of the error. |
Returns
Type | Description |
---|---|
Result<IDiscordInteractionResponse> | Result<T> of IDiscordInteractionResponse containing the error result. |
FromError(String)
Creates a result object with an ErrorResult containing the given errorMessage
.
Declaration
protected static Result<IDiscordInteractionResponse> FromError(string errorMessage)
Parameters
Type | Name | Description |
---|---|---|
System.String | errorMessage | The error details. |
Returns
Type | Description |
---|---|
Result<IDiscordInteractionResponse> | Result<T> of IDiscordInteractionResponse containing the error result. |
FromSuccess(IDiscordEmbed, Boolean)
Create a result object from a IDiscordEmbed.
Declaration
protected static Result<IDiscordInteractionResponse> FromSuccess(IDiscordEmbed embed, bool isPrivate = false)
Parameters
Type | Name | Description |
---|---|---|
IDiscordEmbed | embed | The embed that will be returned to discord. |
System.Boolean | isPrivate | Whether or not the message should be private. |
Returns
Type | Description |
---|---|
Result<IDiscordInteractionResponse> | Result<T> of IDiscordInteractionResponse containing the response. |
FromSuccess(IDiscordInteractionResponse)
Create a result object from a IDiscordInteractionResponse.
Declaration
protected static Result<IDiscordInteractionResponse> FromSuccess(IDiscordInteractionResponse response)
Parameters
Type | Name | Description |
---|---|---|
IDiscordInteractionResponse | response | The response that will be send to discord. |
Returns
Type | Description |
---|---|
Result<IDiscordInteractionResponse> | Result of IDiscordInteractionResponse containing the response. |
FromSuccess(String, Boolean)
Create a result object from a content string.
Declaration
protected static Result<IDiscordInteractionResponse> FromSuccess(string content, bool isPrivate = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | The content of the message. |
System.Boolean | isPrivate | Whether or not the message should be private. |
Returns
Type | Description |
---|---|
Result<IDiscordInteractionResponse> | Result<T> of IDiscordInteractionResponse containing the response. |