इसके माध्यम से साझा किया गया


TeamsActivityHandler Class

Definition

The TeamsActivityHandler is derived from ActivityHandler. It adds support for the Microsoft Teams specific events and interactions.

public class TeamsActivityHandler : Microsoft.Bot.Builder.ActivityHandler
type TeamsActivityHandler = class
    inherit ActivityHandler
Public Class TeamsActivityHandler
Inherits ActivityHandler
Inheritance
TeamsActivityHandler

Constructors

TeamsActivityHandler()

Methods

OnAdaptiveCardInvokeAsync(ITurnContext<IInvokeActivity>, AdaptiveCardInvokeValue, CancellationToken)

Invoked when the bot is sent an Adaptive Card Action Execute.

(Inherited from ActivityHandler)
OnCommandActivityAsync(ITurnContext<ICommandActivity>, CancellationToken)

Invoked when a command activity is received when the base behavior of OnTurnAsync(ITurnContext, CancellationToken) is used. Commands are requests to perform an action and receivers typically respond with one or more commandResult activities. Receivers are also expected to explicitly reject unsupported command activities.

(Inherited from ActivityHandler)
OnCommandResultActivityAsync(ITurnContext<ICommandResultActivity>, CancellationToken)

Invoked when a CommandResult activity is received when the base behavior of OnTurnAsync(ITurnContext, CancellationToken) is used. CommandResult activities can be used to communicate the result of a command execution.

(Inherited from ActivityHandler)
OnConversationUpdateActivityAsync(ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a conversation update activity is received from the channel. Conversation update activities are useful when it comes to responding to users being added to or removed from the channel. For example, a bot could respond to a user being added by greeting the user.

OnEndOfConversationActivityAsync(ITurnContext<IEndOfConversationActivity>, CancellationToken)

Override this in a derived class to provide logic specific to EndOfConversation activities, such as the conversational logic.

(Inherited from ActivityHandler)
OnEventActivityAsync(ITurnContext<IEventActivity>, CancellationToken)

Invoked when an event activity is received from the channel. Event activities can be used to communicate many different things.

OnEventAsync(ITurnContext<IEventActivity>, CancellationToken)

Invoked when an event other than tokens/response is received when the base behavior of OnEventActivityAsync(ITurnContext<IEventActivity>, CancellationToken) is used. This method could optionally be overridden if the bot is meant to handle miscellaneous events. By default, this method does nothing.

(Inherited from ActivityHandler)
OnInstallationUpdateActivityAsync(ITurnContext<IInstallationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic specific to InstallationUpdate activities.

(Inherited from ActivityHandler)
OnInstallationUpdateAddAsync(ITurnContext<IInstallationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic specific to InstallationUpdate activities with 'action' set to 'add'.

(Inherited from ActivityHandler)
OnInstallationUpdateRemoveAsync(ITurnContext<IInstallationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic specific to InstallationUpdate activities with 'action' set to 'remove'.

(Inherited from ActivityHandler)
OnInvokeActivityAsync(ITurnContext<IInvokeActivity>, CancellationToken)

Invoked when an invoke activity is received from the connector. Invoke activities can be used to communicate many different things.

OnMembersAddedAsync(IList<ChannelAccount>, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic for when members other than the bot join the conversation, such as your bot's welcome logic.

(Inherited from ActivityHandler)
OnMembersRemovedAsync(IList<ChannelAccount>, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic for when members other than the bot leave the conversation, such as your bot's good-bye logic.

(Inherited from ActivityHandler)
OnMessageActivityAsync(ITurnContext<IMessageActivity>, CancellationToken)

Override this in a derived class to provide logic specific to Message activities, such as the conversational logic.

(Inherited from ActivityHandler)
OnMessageDeleteActivityAsync(ITurnContext<IMessageDeleteActivity>, CancellationToken)

Invoked when an message delete activity is received. MessageDelete activities, such as the conversational logic.

OnMessageReactionActivityAsync(ITurnContext<IMessageReactionActivity>, CancellationToken)

Invoked when an event activity is received from the connector when the base behavior of OnTurnAsync(ITurnContext, CancellationToken) is used. Message reactions correspond to the user adding a 'like' or 'sad' etc. (often an emoji) to a previously sent activity. Message reactions are only supported by a few channels. The activity that the message reaction corresponds to is indicated in the replyToId property. The value of this property is the activity id of a previously sent activity given back to the bot as the response from a send call.

(Inherited from ActivityHandler)
OnMessageUpdateActivityAsync(ITurnContext<IMessageUpdateActivity>, CancellationToken)

Invoked when an message update activity is received. MessageUpdate activities, such as the conversational logic.

OnReactionsAddedAsync(IList<MessageReaction>, ITurnContext<IMessageReactionActivity>, CancellationToken)

Override this in a derived class to provide logic for when reactions to a previous activity are added to the conversation.

(Inherited from ActivityHandler)
OnReactionsRemovedAsync(IList<MessageReaction>, ITurnContext<IMessageReactionActivity>, CancellationToken)

Override this in a derived class to provide logic for when reactions to a previous activity are removed from the conversation.

(Inherited from ActivityHandler)
OnSearchInvokeAsync(ITurnContext<IInvokeActivity>, SearchInvokeValue, CancellationToken)

Invoked when the bot is sent an 'invoke' activity having name of 'application/search'.

(Inherited from ActivityHandler)
OnSignInInvokeAsync(ITurnContext<IInvokeActivity>, CancellationToken)

Invoked when a signIn invoke activity is received from the connector.

OnTeamsAnonymousAppBasedLinkQueryAsync(ITurnContext<IInvokeActivity>, AppBasedLinkQuery, CancellationToken)

Invoked when an anonymous app based link query activity is received from the connector.

OnTeamsAppBasedLinkQueryAsync(ITurnContext<IInvokeActivity>, AppBasedLinkQuery, CancellationToken)

Invoked when an app based link query activity is received from the connector.

OnTeamsCardActionInvokeAsync(ITurnContext<IInvokeActivity>, CancellationToken)

Invoked when an card action invoke activity is received from the connector.

OnTeamsChannelCreatedAsync(ChannelInfo, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Channel Created event activity is received from the connector. Channel Created correspond to the user creating a new channel.

OnTeamsChannelDeletedAsync(ChannelInfo, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Channel Deleted event activity is received from the connector. Channel Deleted correspond to the user deleting an existing channel.

OnTeamsChannelRenamedAsync(ChannelInfo, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Channel Renamed event activity is received from the connector. Channel Renamed correspond to the user renaming an existing channel.

OnTeamsChannelRestoredAsync(ChannelInfo, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Channel Restored event activity is received from the connector. Channel Restored correspond to the user restoring a previously deleted channel.

OnTeamsConfigFetchAsync(ITurnContext<IInvokeActivity>, JObject, CancellationToken)

Override this in a derived class to provide logic for when a config is fetched.

OnTeamsConfigSubmitAsync(ITurnContext<IInvokeActivity>, JObject, CancellationToken)

Override this in a derived class to provide logic for when a config is submitted.

OnTeamsFileConsentAcceptAsync(ITurnContext<IInvokeActivity>, FileConsentCardResponse, CancellationToken)

Invoked when a file consent card is accepted by the user.

OnTeamsFileConsentAsync(ITurnContext<IInvokeActivity>, FileConsentCardResponse, CancellationToken)

Invoked when a file consent card activity is received from the connector.

OnTeamsFileConsentDeclineAsync(ITurnContext<IInvokeActivity>, FileConsentCardResponse, CancellationToken)

Invoked when a file consent card is declined by the user.

OnTeamsMeetingEndAsync(MeetingEndEventDetails, ITurnContext<IEventActivity>, CancellationToken)

Invoked when a Teams Meeting End event activity is received from the connector. Override this in a derived class to provide logic for when a meeting is ended.

OnTeamsMeetingParticipantsJoinAsync(MeetingParticipantsEventDetails, ITurnContext<IEventActivity>, CancellationToken)

Invoked when a Teams Participants Join event activity is received from the connector. Override this in a derived class to provide logic for when meeting participants are added.

OnTeamsMeetingParticipantsLeaveAsync(MeetingParticipantsEventDetails, ITurnContext<IEventActivity>, CancellationToken)

Invoked when a Teams Participants Leave event activity is received from the connector. Override this in a derived class to provide logic for when meeting participants are removed.

OnTeamsMeetingStartAsync(MeetingStartEventDetails, ITurnContext<IEventActivity>, CancellationToken)

Invoked when a Teams Meeting Start event activity is received from the connector. Override this in a derived class to provide logic for when a meeting is started.

OnTeamsMembersAddedAsync(IList<TeamsChannelAccount>, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic.

OnTeamsMembersAddedDispatchAsync(IList<ChannelAccount>, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic for when members other than the bot join the channel, such as your bot's welcome logic. UseIt will get the associated members with the provided accounts.

OnTeamsMembersRemovedAsync(IList<TeamsChannelAccount>, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic.

OnTeamsMembersRemovedDispatchAsync(IList<ChannelAccount>, TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Override this in a derived class to provide logic for when members other than the bot leave the channel, such as your bot's good-bye logic. It will get the associated members with the provided accounts.

OnTeamsMessageEditAsync(ITurnContext<IMessageUpdateActivity>, CancellationToken)

Invoked when a edit message event activity is received.

OnTeamsMessageSoftDeleteAsync(ITurnContext<IMessageDeleteActivity>, CancellationToken)

Invoked when a soft delete message event activity is received.

OnTeamsMessageUndeleteAsync(ITurnContext<IMessageUpdateActivity>, CancellationToken)

Invoked when a undo soft delete message event activity is received.

OnTeamsMessagingExtensionBotMessagePreviewEditAsync(ITurnContext<IInvokeActivity>, MessagingExtensionAction, CancellationToken)

Invoked when a messaging extension bot message preview edit activity is received from the connector.

OnTeamsMessagingExtensionBotMessagePreviewSendAsync(ITurnContext<IInvokeActivity>, MessagingExtensionAction, CancellationToken)

Invoked when a messaging extension bot message preview send activity is received from the connector.

OnTeamsMessagingExtensionCardButtonClickedAsync(ITurnContext<IInvokeActivity>, JObject, CancellationToken)

Override this in a derived class to provide logic for when a card button is clicked in a messaging extension.

OnTeamsMessagingExtensionConfigurationQuerySettingUrlAsync(ITurnContext<IInvokeActivity>, MessagingExtensionQuery, CancellationToken)

Invoked when a messaging extension configuration query setting url activity is received from the connector.

OnTeamsMessagingExtensionConfigurationSettingAsync(ITurnContext<IInvokeActivity>, JObject, CancellationToken)

Override this in a derived class to provide logic for when a configuration is set for a messaging extension.

OnTeamsMessagingExtensionFetchTaskAsync(ITurnContext<IInvokeActivity>, MessagingExtensionAction, CancellationToken)

Invoked when a Messaging Extension Fetch activity is received from the connector.

OnTeamsMessagingExtensionQueryAsync(ITurnContext<IInvokeActivity>, MessagingExtensionQuery, CancellationToken)

Invoked when a Messaging Extension Query activity is received from the connector.

OnTeamsMessagingExtensionSelectItemAsync(ITurnContext<IInvokeActivity>, JObject, CancellationToken)

Invoked when a messaging extension select item activity is received from the connector.

OnTeamsMessagingExtensionSubmitActionAsync(ITurnContext<IInvokeActivity>, MessagingExtensionAction, CancellationToken)

Invoked when a messaging extension submit action activity is received from the connector.

OnTeamsMessagingExtensionSubmitActionDispatchAsync(ITurnContext<IInvokeActivity>, MessagingExtensionAction, CancellationToken)

Invoked when a messaging extension submit action dispatch activity is received from the connector.

OnTeamsO365ConnectorCardActionAsync(ITurnContext<IInvokeActivity>, O365ConnectorCardActionQuery, CancellationToken)

Invoked when a O365 Connector Card Action activity is received from the connector.

OnTeamsReadReceiptAsync(ReadReceiptInfo, ITurnContext<IEventActivity>, CancellationToken)

Invoked when a read receipt for a previously sent message is received from the connector. Override this in a derived class to provide logic for when the bot receives a read receipt event.

OnTeamsSigninVerifyStateAsync(ITurnContext<IInvokeActivity>, CancellationToken)

Invoked when a signIn verify state activity is received from the connector.

OnTeamsTabFetchAsync(ITurnContext<IInvokeActivity>, TabRequest, CancellationToken)

Override this in a derived class to provide logic for when a tab is fetched.

OnTeamsTabSubmitAsync(ITurnContext<IInvokeActivity>, TabSubmit, CancellationToken)

Override this in a derived class to provide logic for when a tab is submitted.

OnTeamsTaskModuleFetchAsync(ITurnContext<IInvokeActivity>, TaskModuleRequest, CancellationToken)

Override this in a derived class to provide logic for when a task module is fetched.

OnTeamsTaskModuleSubmitAsync(ITurnContext<IInvokeActivity>, TaskModuleRequest, CancellationToken)

Override this in a derived class to provide logic for when a task module is submited.

OnTeamsTeamArchivedAsync(TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Team Archived event activity is received from the connector. Team Archived correspond to the user archiving a team.

OnTeamsTeamDeletedAsync(TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Team Deleted event activity is received from the connector. Team Deleted corresponds to the user deleting a team.

OnTeamsTeamHardDeletedAsync(TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Team Hard Deleted event activity is received from the connector. Team Hard Deleted corresponds to the user hard deleting a team.

OnTeamsTeamRenamedAsync(TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Team Renamed event activity is received from the connector. Team Renamed correspond to the user renaming an existing team.

OnTeamsTeamRestoredAsync(TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Team Restored event activity is received from the connector. Team Restored corresponds to the user restoring a team.

OnTeamsTeamUnarchivedAsync(TeamInfo, ITurnContext<IConversationUpdateActivity>, CancellationToken)

Invoked when a Team Unarchived event activity is received from the connector. Team Unarchived correspond to the user unarchiving a team.

OnTokenResponseEventAsync(ITurnContext<IEventActivity>, CancellationToken)

Invoked when a tokens/response event is received when the base behavior of OnEventActivityAsync(ITurnContext<IEventActivity>, CancellationToken) is used. If using an OAuthPrompt, override this method to forward this Activity to the current dialog. By default, this method does nothing.

(Inherited from ActivityHandler)
OnTurnAsync(ITurnContext, CancellationToken)

Called by the adapter (for example, a BotFrameworkAdapter) at runtime in order to process an inbound Activity.

(Inherited from ActivityHandler)
OnTypingActivityAsync(ITurnContext<ITypingActivity>, CancellationToken)

Override this in a derived class to provide logic specific to Typing activities, such as the conversational logic.

(Inherited from ActivityHandler)
OnUnrecognizedActivityTypeAsync(ITurnContext, CancellationToken)

Invoked when an activity other than a message, conversation update, or event is received when the base behavior of OnTurnAsync(ITurnContext, CancellationToken) is used. If overridden, this could potentially respond to any of the other activity types like ContactRelationUpdate or EndOfConversation. By default, this method does nothing.

(Inherited from ActivityHandler)

Applies to