Share via


ITurnContext<T> Interface

Definition

Provides context for a turn of a bot, where the context's Activity property is strongly typed.

public interface ITurnContext<T> : Microsoft.Bot.Builder.ITurnContext where T : IActivity
type ITurnContext<'T (requires 'T :> IActivity)> = interface
    interface ITurnContext
Public Interface ITurnContext(Of T)
Implements ITurnContext

Type Parameters

T

The activity type for this turn of the bot.

Derived
Implements

Remarks

The IActivity interface defines properties shared by every type of activity. The interfaces that derive from IActivity include properties specific to a specific type of activity. For example, IMessageActivity includes properties associated with message activities, and IEventActivity includes properties associated with event activities.

Properties

Activity

Gets the activity for this turn of the bot.

Adapter

Gets the bot adapter that created this context object.

(Inherited from ITurnContext)
Responded

Gets a value indicating whether at least one response was sent for the current turn.

(Inherited from ITurnContext)
TurnState

Gets the collection of values cached with the context object for the lifetime of the turn.

(Inherited from ITurnContext)

Methods

DeleteActivityAsync(ConversationReference, CancellationToken)

Deletes an existing activity.

(Inherited from ITurnContext)
DeleteActivityAsync(String, CancellationToken)

Deletes an existing activity.

(Inherited from ITurnContext)
OnDeleteActivity(DeleteActivityHandler)

Adds a response handler for delete activity operations.

(Inherited from ITurnContext)
OnSendActivities(SendActivitiesHandler)

Adds a response handler for send activity operations.

(Inherited from ITurnContext)
OnUpdateActivity(UpdateActivityHandler)

Adds a response handler for update activity operations.

(Inherited from ITurnContext)
SendActivitiesAsync(IActivity[], CancellationToken)

Sends a set of activities to the sender of the incoming activity.

(Inherited from ITurnContext)
SendActivityAsync(IActivity, CancellationToken)

Sends an activity to the sender of the incoming activity.

(Inherited from ITurnContext)
SendActivityAsync(String, String, String, CancellationToken)

Sends a message activity to the sender of the incoming activity.

(Inherited from ITurnContext)
UpdateActivityAsync(IActivity, CancellationToken)

Replaces an existing activity.

(Inherited from ITurnContext)

Extension Methods

GetDebugger(ITurnContext)

Extension method to get IDialogDebugger from TurnContext.

TraceActivityAsync(ITurnContext, String, Object, String, String, CancellationToken)

Sends a trace activity to the BotAdapter for logging purposes.

Applies to

See also