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.
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
StreamUrl
Gets and sets the expression to resolve the stream url of that activity.
public IExpression? StreamUrl { 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.