616 lines
No EOL
32 KiB
TypeScript
616 lines
No EOL
32 KiB
TypeScript
/**
|
|
* @module botbuilder
|
|
*/
|
|
/**
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
import { ActivityHandler, AppBasedLinkQuery, ChannelInfo, ConfigResponse, FileConsentCardResponse, InvokeResponse, MeetingEndEventDetails, MeetingParticipantsEventDetails, MeetingStartEventDetails, MessagingExtensionAction, MessagingExtensionActionResponse, MessagingExtensionQuery, MessagingExtensionResponse, O365ConnectorCardActionQuery, SigninStateVerificationQuery, TabRequest, TabResponse, TabSubmit, TaskModuleRequest, TaskModuleResponse, TeamInfo, TeamsChannelAccount, TurnContext } from 'botbuilder-core';
|
|
import { ReadReceiptInfo } from 'botframework-connector';
|
|
/**
|
|
* Adds support for Microsoft Teams specific events and interactions.
|
|
*
|
|
* @remarks
|
|
* Developers may handle Message Update, Message Delete, and Conversation Update activities sent from Microsoft Teams via two methods:
|
|
* 1. Overriding methods starting with `on..` and *not* ending in `..Event()` (e.g. `onTeamsMembersAdded()`), or instead
|
|
* 2. Passing callbacks to methods starting with `on..` *and* ending in `...Event()` (e.g. `onTeamsMembersAddedEvent()`),
|
|
* to stay in line with older {@see ActivityHandler} implementation.
|
|
*
|
|
* Developers should use either #1 or #2, above for all Message Update, Message Delete, and Conversation Update activities and not *both* #1 and #2 for the same activity. Meaning,
|
|
* developers should override `onTeamsMembersAdded()` and not use both `onTeamsMembersAdded()` and `onTeamsMembersAddedEvent()`.
|
|
*
|
|
* Developers wanting to handle Invoke activities *must* override methods starting with `handle...()` (e.g. `handleTeamsTaskModuleFetch()`).
|
|
*/
|
|
export declare class TeamsActivityHandler extends ActivityHandler {
|
|
/**
|
|
* Invoked when an invoke activity is received from the connector.
|
|
* Invoke activities can be used to communicate many different things.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns An Invoke Response for the activity.
|
|
*/
|
|
protected onInvokeActivity(context: TurnContext): Promise<InvokeResponse>;
|
|
/**
|
|
* Handles a Teams Card Action Invoke activity.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @returns An Invoke Response for the activity.
|
|
*/
|
|
protected handleTeamsCardActionInvoke(_context: TurnContext): Promise<InvokeResponse>;
|
|
/**
|
|
* Handles a config/fetch invoke activity.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _configData The object representing the configuration.
|
|
* @returns A Config Response for the activity.
|
|
*/
|
|
protected handleTeamsConfigFetch(_context: TurnContext, _configData: any): Promise<ConfigResponse>;
|
|
/**
|
|
* Handles a config/submit invoke activity.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _configData The object representing the configuration.
|
|
* @returns A Config Response for the activity.
|
|
*/
|
|
protected handleTeamsConfigSubmit(_context: TurnContext, _configData: any): Promise<ConfigResponse>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'fileConsent/invoke'. Handlers registered here run before
|
|
* `handleTeamsFileConsentAccept` and `handleTeamsFileConsentDecline`.
|
|
* Developers are not passed a pointer to the next `handleTeamsFileConsent` handler because the _wrapper_ around
|
|
* the handler will call `onDialogs` handlers after delegating to `handleTeamsFileConsentAccept` or `handleTeamsFileConsentDecline`.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @param fileConsentCardResponse Represents the value of the invoke activity sent when the user acts on a file consent card.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsFileConsent(context: TurnContext, fileConsentCardResponse: FileConsentCardResponse): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'fileConsent/invoke' with confirmation from user
|
|
*
|
|
* @remarks
|
|
* This type of invoke activity occur during the File Consent flow.
|
|
* @param _context A context object for this turn.
|
|
* @param _fileConsentCardResponse Represents the value of the invoke activity sent when the user acts on a file consent card.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsFileConsentAccept(_context: TurnContext, _fileConsentCardResponse: FileConsentCardResponse): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'fileConsent/invoke' with decline from user
|
|
*
|
|
* @remarks
|
|
* This type of invoke activity occur during the File Consent flow.
|
|
* @param _context A context object for this turn.
|
|
* @param _fileConsentCardResponse Represents the value of the invoke activity sent when the user acts on a file consent card.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsFileConsentDecline(_context: TurnContext, _fileConsentCardResponse: FileConsentCardResponse): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'actionableMessage/executeAction'.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _query The O365 connector card HttpPOST invoke query.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsO365ConnectorCardAction(_context: TurnContext, _query: O365ConnectorCardActionQuery): Promise<void>;
|
|
/**
|
|
* Invoked when a signIn invoke activity is received from the connector.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onSignInInvoke(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'signin/verifyState'.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _query Signin state (part of signin action auth flow) verification invoke query.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsSigninVerifyState(_context: TurnContext, _query: SigninStateVerificationQuery): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'signin/tokenExchange'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _query Signin state (part of signin action auth flow) verification invoke query
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsSigninTokenExchange(_context: TurnContext, _query: SigninStateVerificationQuery): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'composeExtension/onCardButtonClicked'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _cardData Object representing the card data.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected handleTeamsMessagingExtensionCardButtonClicked(_context: TurnContext, _cardData: any): Promise<void>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'task/fetch'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _taskModuleRequest The task module invoke request value payload.
|
|
* @returns A Task Module Response for the request.
|
|
*/
|
|
protected handleTeamsTaskModuleFetch(_context: TurnContext, _taskModuleRequest: TaskModuleRequest): Promise<TaskModuleResponse>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'task/submit'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _taskModuleRequest The task module invoke request value payload.
|
|
* @returns A Task Module Response for the request.
|
|
*/
|
|
protected handleTeamsTaskModuleSubmit(_context: TurnContext, _taskModuleRequest: TaskModuleRequest): Promise<TaskModuleResponse>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'tab/fetch'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _tabRequest The tab invoke request value payload.
|
|
* @returns A Tab Response for the request.
|
|
*/
|
|
protected handleTeamsTabFetch(_context: TurnContext, _tabRequest: TabRequest): Promise<TabResponse>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'tab/submit'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _tabSubmit The tab submit invoke request value payload.
|
|
* @returns A Tab Response for the request.
|
|
*/
|
|
protected handleTeamsTabSubmit(_context: TurnContext, _tabSubmit: TabSubmit): Promise<TabResponse>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'composeExtension/queryLink'
|
|
*
|
|
* @remarks
|
|
* Used in creating a Search-based Message Extension.
|
|
* @param _context A context object for this turn.
|
|
* @param _query he invoke request body type for app-based link query.
|
|
* @returns The Messaging Extension Response for the query.
|
|
*/
|
|
protected handleTeamsAppBasedLinkQuery(_context: TurnContext, _query: AppBasedLinkQuery): Promise<MessagingExtensionResponse>;
|
|
/**
|
|
* Receives invoke activities with Activity name of 'composeExtension/anonymousQueryLink'
|
|
*
|
|
* @remarks
|
|
* Used in creating a Search-based Message Extension.
|
|
* @param _context A context object for this turn.
|
|
* @param _query he invoke request body type for app-based link query.
|
|
* @returns The Messaging Extension Response for the query.
|
|
*/
|
|
protected handleTeamsAnonymousAppBasedLinkQuery(_context: TurnContext, _query: AppBasedLinkQuery): Promise<MessagingExtensionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/query'.
|
|
*
|
|
* @remarks
|
|
* Used in creating a Search-based Message Extension.
|
|
* @param _context A context object for this turn.
|
|
* @param _query The query for the search command.
|
|
* @returns The Messaging Extension Response for the query.
|
|
*/
|
|
protected handleTeamsMessagingExtensionQuery(_context: TurnContext, _query: MessagingExtensionQuery): Promise<MessagingExtensionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/selectItem'.
|
|
*
|
|
* @remarks
|
|
* Used in creating a Search-based Message Extension.
|
|
* @param _context A context object for this turn.
|
|
* @param _query The object representing the query.
|
|
* @returns The Messaging Extension Response for the query.
|
|
*/
|
|
protected handleTeamsMessagingExtensionSelectItem(_context: TurnContext, _query: any): Promise<MessagingExtensionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/submitAction' and dispatches to botMessagePreview-flows as applicable.
|
|
*
|
|
* @remarks
|
|
* A handler registered through this method does not dispatch to the next handler (either `handleTeamsMessagingExtensionSubmitAction`, `handleTeamsMessagingExtensionBotMessagePreviewEdit`, or `handleTeamsMessagingExtensionBotMessagePreviewSend`).
|
|
* This method exists for developers to optionally add more logic before the TeamsActivityHandler routes the activity to one of the
|
|
* previously mentioned handlers.
|
|
* @param context A context object for this turn.
|
|
* @param action The messaging extension action.
|
|
* @returns The Messaging Extension Action Response for the action.
|
|
*/
|
|
protected handleTeamsMessagingExtensionSubmitActionDispatch(context: TurnContext, action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/submitAction'.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _action The messaging extension action.
|
|
* @returns The Messaging Extension Action Response for the action.
|
|
*/
|
|
protected handleTeamsMessagingExtensionSubmitAction(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/submitAction' with the 'botMessagePreview' property present on activity.value.
|
|
* The value for 'botMessagePreview' is 'edit'.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _action The messaging extension action.
|
|
* @returns The Messaging Extension Action Response for the action.
|
|
*/
|
|
protected handleTeamsMessagingExtensionBotMessagePreviewEdit(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/submitAction' with the 'botMessagePreview' property present on activity.value.
|
|
* The value for 'botMessagePreview' is 'send'.
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _action The messaging extension action.
|
|
* @returns The Messaging Extension Action Response for the action.
|
|
*/
|
|
protected handleTeamsMessagingExtensionBotMessagePreviewSend(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/fetchTask'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _action The messaging extension action.
|
|
* @returns The Messaging Extension Action Response for the action.
|
|
*/
|
|
protected handleTeamsMessagingExtensionFetchTask(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/querySettingUrl'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _query The Messaging extension query.
|
|
* @returns The Messaging Extension Action Response for the query.
|
|
*/
|
|
protected handleTeamsMessagingExtensionConfigurationQuerySettingUrl(_context: TurnContext, _query: MessagingExtensionQuery): Promise<MessagingExtensionResponse>;
|
|
/**
|
|
* Receives invoke activities with the name 'composeExtension/setting'
|
|
*
|
|
* @param _context A context object for this turn.
|
|
* @param _settings Object representing the configuration settings.
|
|
*/
|
|
protected handleTeamsMessagingExtensionConfigurationSetting(_context: TurnContext, _settings: any): Promise<void>;
|
|
/**
|
|
* Override this method to change the dispatching of ConversationUpdate activities.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected dispatchConversationUpdateActivity(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Override this method to change the dispatching of MessageUpdate activities.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected dispatchMessageUpdateActivity(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Override this method to change the dispatching of MessageDelete activities.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected dispatchMessageDeleteActivity(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Called in `dispatchMessageUpdateActivity()` to trigger the `'TeamsMessageUndelete'` handlers.
|
|
* Override this in a derived class to provide logic for when a deleted message in a conversation is undeleted.
|
|
* For example, when the user decides to "undo" a deleted message.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMessageUndelete(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Called in `dispatchMessageUpdateActivity()` to trigger the `'TeamsMessageEdit'` handlers.
|
|
* Override this in a derived class to provide logic for when a message in a conversation is edited.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMessageEdit(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Called in `dispatchMessageDeleteActivity()` to trigger the `'TeamsMessageEdit'` handlers.
|
|
* Override this in a derived class to provide logic for when a message in a conversation is soft deleted.
|
|
* This means that the message as the option of being undeleted.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMessageSoftDelete(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Called in `dispatchConversationUpdateActivity()` to trigger the `'TeamsMembersAdded'` handlers.
|
|
* 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.
|
|
*
|
|
* @remarks
|
|
* If no handlers are registered for the `'TeamsMembersAdded'` event, the `'MembersAdded'` handlers will run instead.
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMembersAdded(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Called in `dispatchConversationUpdateActivity()` to trigger the `'TeamsMembersRemoved'` handlers.
|
|
* 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.
|
|
*
|
|
* @remarks
|
|
* If no handlers are registered for the `'TeamsMembersRemoved'` event, the `'MembersRemoved'` handlers will run instead.
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMembersRemoved(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Channel Created event activity is received from the connector.
|
|
* Channel Created corresponds to the user creating a new channel.
|
|
* Override this in a derived class to provide logic for when a channel is created.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsChannelCreated(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Channel Deleted event activity is received from the connector.
|
|
* Channel Deleted corresponds to the user deleting a channel.
|
|
* Override this in a derived class to provide logic for when a channel is deleted.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsChannelDeleted(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Channel Renamed event activity is received from the connector.
|
|
* Channel Renamed corresponds to the user renaming a new channel.
|
|
* Override this in a derived class to provide logic for when a channel is renamed.
|
|
*
|
|
* @param context A context object for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsChannelRenamed(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Team Archived event activity is received from the connector.
|
|
* Team Archived corresponds to the user archiving a team.
|
|
* Override this in a derived class to provide logic for when a team is archived.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsTeamArchived(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Team Deleted event activity is received from the connector.
|
|
* Team Deleted corresponds to the user deleting a team.
|
|
* Override this in a derived class to provide logic for when a team is deleted.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsTeamDeleted(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Team Hard Deleted event activity is received from the connector.
|
|
* Team Hard Deleted corresponds to the user hard-deleting a team.
|
|
* Override this in a derived class to provide logic for when a team is hard-deleted.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsTeamHardDeleted(context: TurnContext): Promise<void>;
|
|
/**
|
|
*
|
|
* Invoked when a Channel Restored event activity is received from the connector.
|
|
* Channel Restored corresponds to the user restoring a previously deleted channel.
|
|
* Override this in a derived class to provide logic for when a channel is restored.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsChannelRestored(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Team Renamed event activity is received from the connector.
|
|
* Team Renamed corresponds to the user renaming a team.
|
|
* Override this in a derived class to provide logic for when a team is renamed.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsTeamRenamed(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Team Restored event activity is received from the connector.
|
|
* Team Restored corresponds to the user restoring a team.
|
|
* Override this in a derived class to provide logic for when a team is restored.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsTeamRestored(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Team Unarchived event activity is received from the connector.
|
|
* Team Unarchived corresponds to the user unarchiving a team.
|
|
* Override this in a derived class to provide logic for when a team is unarchived.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsTeamUnarchived(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Registers a handler for TeamsMessageUndelete events, such as for when a message in a conversation that is
|
|
* observed by the bot goes from a soft delete state to the normal state.
|
|
*
|
|
* @param handler A callback to handle the teams undelete message event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMessageUndeleteEvent(handler: (context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsMessageEdit events, such as for when a message in a conversation that is
|
|
* observed by the bot is edited.
|
|
*
|
|
* @param handler A callback to handle the teams edit message event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMessageEditEvent(handler: (context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsMessageSoftDelete events, such as for when a message in a conversation that is
|
|
* observed by the bot is soft deleted. This means that the deleted message, up to a certain time period,
|
|
* can be undoed.
|
|
*
|
|
* @param handler A callback to handle the teams edit message event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMessageSoftDeleteEvent(handler: (context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsMembersAdded events, such as for when members other than the bot
|
|
* join the channel, such as your bot's welcome logic.
|
|
*
|
|
* @param handler A callback to handle the teams members added event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMembersAddedEvent(handler: (membersAdded: TeamsChannelAccount[], teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsMembersRemoved events, such as for when members other than the bot
|
|
* leave the channel, such as your bot's good-bye logic.
|
|
*
|
|
* @param handler A callback to handle the teams members removed event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMembersRemovedEvent(handler: (membersRemoved: TeamsChannelAccount[], teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsChannelCreated events, such as for when a channel is created.
|
|
*
|
|
* @param handler A callback to handle the teams channel created event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsChannelCreatedEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsChannelDeleted events, such as for when a channel is deleted.
|
|
*
|
|
* @param handler A callback to handle the teams channel deleted event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsChannelDeletedEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsChannelRenamed events, such as for when a channel is renamed.
|
|
*
|
|
* @param handler A callback to handle the teams channel renamed event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsChannelRenamedEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsTeamArchived events, such as for when a team is archived.
|
|
*
|
|
* @param handler A callback to handle the teams team archived event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsTeamArchivedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsTeamDeleted events, such as for when a team is deleted.
|
|
*
|
|
* @param handler A callback to handle the teams team deleted event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsTeamDeletedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsTeamHardDeleted events, such as for when a team is hard-deleted.
|
|
*
|
|
* @param handler A callback to handle the teams team hard deleted event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsTeamHardDeletedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsChannelRestored events, such as for when a channel is restored.
|
|
*
|
|
* @param handler A callback to handle the teams channel restored event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsChannelRestoredEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsTeamRenamed events, such as for when a team is renamed.
|
|
*
|
|
* @param handler A callback to handle the teams team renamed event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsTeamRenamedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsTeamRestored events, such as for when a team is restored.
|
|
*
|
|
* @param handler A callback to handle the teams team restored event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsTeamRestoredEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for TeamsTeamUnarchived events, such as for when a team is unarchived.
|
|
*
|
|
* @param handler A callback to handle the teams team unarchived event.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsTeamUnarchivedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Runs the _event_ sub-type handlers, as appropriate, and then continues the event emission process.
|
|
*
|
|
* @param context The context object for the current turn.
|
|
* @returns A promise that represents the work queued.
|
|
* @remarks
|
|
* Override this method to support channel-specific behavior across multiple channels or to add
|
|
* custom event sub-type events.
|
|
*/
|
|
protected dispatchEventActivity(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Meeting Started event activity is received from the connector.
|
|
* Override this in a derived class to provide logic for when a meeting is started.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMeetingStart(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Meeting End event activity is received from the connector.
|
|
* Override this in a derived class to provide logic for when a meeting is ended.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMeetingEnd(context: TurnContext): Promise<void>;
|
|
/**
|
|
* 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.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsReadReceipt(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Meeting Participant Join event activity is received from the connector.
|
|
* Override this in a derived class to provide logic for when a meeting participant is joined.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMeetingParticipantsJoin(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Invoked when a Meeting Participant Leave event activity is received from the connector.
|
|
* Override this in a derived class to provide logic for when a meeting participant is left.
|
|
*
|
|
* @param context The context for this turn.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
protected onTeamsMeetingParticipantsLeave(context: TurnContext): Promise<void>;
|
|
/**
|
|
* Registers a handler for when a Teams meeting starts.
|
|
*
|
|
* @param handler A callback that handles Meeting Start events.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMeetingStartEvent(handler: (meeting: MeetingStartEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for when a Teams meeting ends.
|
|
*
|
|
* @param handler A callback that handles Meeting End events.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMeetingEndEvent(handler: (meeting: MeetingEndEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for when a Read Receipt is sent.
|
|
*
|
|
* @param handler A callback that handles Read Receipt events.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsReadReceiptEvent(handler: (receiptInfo: ReadReceiptInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for when a Teams meeting participant join.
|
|
*
|
|
* @param handler A callback that handles Meeting Participant Join events.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMeetingParticipantsJoinEvent(handler: (meeting: MeetingParticipantsEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
/**
|
|
* Registers a handler for when a Teams meeting participant leave.
|
|
*
|
|
* @param handler A callback that handles Meeting Participant Leave events.
|
|
* @returns A promise that represents the work queued.
|
|
*/
|
|
onTeamsMeetingParticipantsLeaveEvent(handler: (meeting: MeetingParticipantsEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
|
}
|
|
//# sourceMappingURL=teamsActivityHandler.d.ts.map
|