Sprache

ActivityHandler.OnInvokeActivityAsync Methode

Definition

Wird aufgerufen, wenn eine Aufrufaktivität vom Connector empfangen wird, wenn das Basisverhalten von OnTurnAsync(ITurnContext, CancellationToken) verwendet wird. Aufrufaktivitäten können verwendet werden, um viele verschiedene Dinge zu kommunizieren. Standardmäßig ruft diese Methode auf, OnSignInInvokeAsync(ITurnContext<IInvokeActivity>, CancellationToken) wenn der Name der Aktivität oder signin/tokenExchangeistsignin/verifyState. A signin/verifyState oder signin/tokenExchange Invoke kann durch ein OAuthCardausgelöst werden.

protected virtual System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse> OnInvokeActivityAsync(Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IInvokeActivity> turnContext, System.Threading.CancellationToken cancellationToken);
abstract member OnInvokeActivityAsync : Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IInvokeActivity> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
override this.OnInvokeActivityAsync : Microsoft.Bot.Builder.ITurnContext<Microsoft.Bot.Schema.IInvokeActivity> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
Protected Overridable Function OnInvokeActivityAsync (turnContext As ITurnContext(Of IInvokeActivity), cancellationToken As CancellationToken) As Task(Of InvokeResponse)

Parameter

turnContext
ITurnContext<IInvokeActivity>

Ein stark typisiertes Kontextobjekt für diese Runde.

cancellationToken
CancellationToken

Ein Abbruchtoken, das von anderen Objekten oder Threads verwendet werden kann, um eine Kündigungsbenachrichtigung zu erhalten.

Gibt zurück

Eine Aufgabe, die die auszuführende Arbeitswarteschlange darstellt.

Hinweise

Wenn die Methode OnTurnAsync(ITurnContext, CancellationToken) eine Aufrufaktivität erhält, ruft sie diese Methode auf. Wenn das Ereignis Name 'signin/verifyState' oder 'signin/tokenExchange' ist, ruft es Invoke-Aktivitäten auf, OnSignInInvokeAsync(ITurnContext<IInvokeActivity>, CancellationToken) um programmatische Befehle von einem Client oder Kanal an einen Bot zu kommunizieren. Die Bedeutung einer Aufrufaktivität wird durch die Name-Eigenschaft definiert, die innerhalb des Bereichs eines Kanals aussagekräftig ist. Ein 'signin/verifyState'- oder 'signin/tokenExchange'-Aufruf kann durch eine OAuthCard oder eine OAuth-Eingabeaufforderung ausgelöst werden.

Gilt für:

Weitere Informationen