Table of Contents

Class DiscordSend

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

Sends a text message to a Discord channel. The DiscordInit must be initialized.

Return type is null.

This json example sends a Discord message to a channel and returns null:
{ "$DiscordSend": { "Message": "Hello World!", "Guild": "MyServer", "Channel": "MyChannel" } }
public sealed class DiscordSend : IExpression
Inheritance
DiscordSend
Implements
Inherited Members

Constructors

DiscordSend()

public DiscordSend()

Properties

AllowedMentions

Gets and sets if user, channel and role mentions are allowed in this message.

Use <@userId> to tag a user, <#channelId> to tag a channel and @<#roleId> to tag a role.

public bool AllowedMentions { get; set; }

Property Value

bool

Channel

Gets and sets the target channel to send the message to. If not defined, it will use the channel from the current runtime context.

public IExpression? Channel { get; set; }

Property Value

IExpression

Embed

Gets and sets the optional embed data for this message.

public DiscordEmbed? Embed { get; set; }

Property Value

DiscordEmbed

Guild

Gets and sets the target guild to send the message to. If not defined, it will use the guild from the current runtime context.

public IExpression? Guild { get; set; }

Property Value

IExpression

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.