Table of Contents

Class DiscordActivity

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

Sets the status activity shown in the current bot users profile. The DiscordInit must be initialized.

Return type is null.

This json example sets the Discord status to "is playing The Game" and returns null:
{ "$DiscordActivity": { "Name": "The Game", "Activity": "Playing" } }
public sealed class DiscordActivity : IExpression
Inheritance
DiscordActivity
Implements
Inherited Members

Constructors

DiscordActivity()

public DiscordActivity()

Properties

Activity

Gets and sets the activity type. See Discord.ActivityType.

[JsonConverter(typeof(EnumConverter<ActivityType>))]
public ActivityType Activity { get; set; }

Property Value

ActivityType

Name

Gets and sets the expression to resolve the activity name.

public IExpression? Name { get; set; }

Property Value

IExpression

StreamUrl

Gets and sets the expression to resolve the stream url of that activity.

public IExpression? StreamUrl { 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.