Table of Contents

Class Delay

Namespace
BotManager.Runtime.Expressions
Assembly
BotManager.Runtime.dll

Holds execution and waits the defined number of milliseconds.

Return type is null.

This json example waits three seconds and returns null:
{ "$Delay": 3000 }
[TypeConverter(typeof(DelayConverter))]
public sealed class Delay : IExpression
Inheritance
Delay
Implements
Inherited Members

Constructors

Delay()

Empty constructor for serialization.

public Delay()

Delay(IExpression?)

Creates an expression that holds execution and waits the defined number of milliseconds.

public Delay(IExpression? milliseconds)

Parameters

milliseconds IExpression

The expression to resolve the number of milliseconds to wait.

Properties

Milliseconds

Gets and sets the expression to resolve the number of milliseconds to wait.

[JsonRootProperty]
public IExpression? Milliseconds { 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.