Table of Contents

Class DiscordRespond

Namespace
BotManager.Discord.Expressions
Assembly
BotManager.Discord.dll

Responds with a text message on a DiscordSlashCommand. The DiscordInit must be initialized.

Return type is null.

This json example sends a Discord message as a command response and returns null:
{ "$DiscordRespond": { "Message": "Got your command!" } }
public sealed class DiscordRespond : IExpression
Inheritance
DiscordRespond
Implements
Inherited Members

Constructors

DiscordRespond()

public DiscordRespond()

Properties

AllowedMentions

Gets and sets if mentions are allowed.

public bool AllowedMentions { get; set; }

Property Value

bool

Embed

Gets and sets the optional embed data for this message.

public DiscordEmbed? Embed { get; set; }

Property Value

DiscordEmbed

Message

Gets and sets the expression to resolve the message.

public IExpression? Message { get; set; }

Property Value

IExpression

Methods

ExecuteAsync(RuntimeContext, Type?)

Executes the expression in the given RuntimeContext. Please do not use this method to run an expression. Use ExecuteAsync(IExpression?) instead.

public Task<object?> ExecuteAsync(RuntimeContext context, Type? returnType)

Parameters

context RuntimeContext

The current runtime context.

returnType Type

The expected return type. Use typeof(object) for a generic result. Use null if you don't need the return value.

Returns

Task<object>

Returns the result of the expression.