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.
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
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
Embed
Gets and sets the optional embed data for this message.
public DiscordEmbed? Embed { get; set; }
Property Value
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
Message
Gets and sets the expression to resolve the message.
public IExpression? Message { get; set; }
Property Value
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
contextRuntimeContextThe current runtime context.
returnTypeTypeThe expected return type. Use
typeof(object)for a generic result. Usenullif you don't need the return value.