Class IBotWithEventsExtensions
Extension methods for IBotWithEvents.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
public static class IBotWithEventsExtensions
Methods
View SourceRunAction<T>(IBotWithEvents<T>, T, CancellationToken)
Runs an action and waits for it to finish.
Declaration
public static Task RunAction<T>(this IBotWithEvents<T> bot, T action, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
IBotWithEvents<T> | bot | The bot being extended. |
T | action | The action. |
CancellationToken | token | A token to monitor for cancellation. |
Returns
Type | Description |
---|---|
Task | A task. |
Type Parameters
Name | Description |
---|---|
T | The action type. |
WaitForActionFinished(IBotWithEvents, Func<Task>?, CancellationToken)
Waits for an action to finish.
Declaration
public static Task WaitForActionFinished(this IBotWithEvents bot, Func<Task>? initialTask = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
IBotWithEvents | bot | The bot being extended. |
Func<Task> | initialTask | An optional task to run after registering the action finished events. |
CancellationToken | token | A token to monitor for cancellation. |
Returns
Type | Description |
---|---|
Task | A task. |