1 | /**
|
2 | * @module botbuilder
|
3 | */
|
4 | /**
|
5 | * Copyright (c) Microsoft Corporation. All rights reserved.
|
6 | * Licensed under the MIT License.
|
7 | */
|
8 | 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';
|
9 | import { ReadReceiptInfo } from 'botframework-connector';
|
10 | /**
|
11 | * Adds support for Microsoft Teams specific events and interactions.
|
12 | *
|
13 | * @remarks
|
14 | * Developers may handle Message Update, Message Delete, and Conversation Update activities sent from Microsoft Teams via two methods:
|
15 | * 1. Overriding methods starting with `on..` and *not* ending in `..Event()` (e.g. `onTeamsMembersAdded()`), or instead
|
16 | * 2. Passing callbacks to methods starting with `on..` *and* ending in `...Event()` (e.g. `onTeamsMembersAddedEvent()`),
|
17 | * to stay in line with older {@see ActivityHandler} implementation.
|
18 | *
|
19 | * 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,
|
20 | * developers should override `onTeamsMembersAdded()` and not use both `onTeamsMembersAdded()` and `onTeamsMembersAddedEvent()`.
|
21 | *
|
22 | * Developers wanting to handle Invoke activities *must* override methods starting with `handle...()` (e.g. `handleTeamsTaskModuleFetch()`).
|
23 | */
|
24 | export declare class TeamsActivityHandler extends ActivityHandler {
|
25 | /**
|
26 | * Invoked when an invoke activity is received from the connector.
|
27 | * Invoke activities can be used to communicate many different things.
|
28 | *
|
29 | * @param context A context object for this turn.
|
30 | * @returns An Invoke Response for the activity.
|
31 | */
|
32 | protected onInvokeActivity(context: TurnContext): Promise<InvokeResponse>;
|
33 | /**
|
34 | * Handles a Teams Card Action Invoke activity.
|
35 | *
|
36 | * @param _context A context object for this turn.
|
37 | * @returns An Invoke Response for the activity.
|
38 | */
|
39 | protected handleTeamsCardActionInvoke(_context: TurnContext): Promise<InvokeResponse>;
|
40 | /**
|
41 | * Handles a config/fetch invoke activity.
|
42 | *
|
43 | * @param _context A context object for this turn.
|
44 | * @param _configData The object representing the configuration.
|
45 | * @returns A Config Response for the activity.
|
46 | */
|
47 | protected handleTeamsConfigFetch(_context: TurnContext, _configData: any): Promise<ConfigResponse>;
|
48 | /**
|
49 | * Handles a config/submit invoke activity.
|
50 | *
|
51 | * @param _context A context object for this turn.
|
52 | * @param _configData The object representing the configuration.
|
53 | * @returns A Config Response for the activity.
|
54 | */
|
55 | protected handleTeamsConfigSubmit(_context: TurnContext, _configData: any): Promise<ConfigResponse>;
|
56 | /**
|
57 | * Receives invoke activities with Activity name of 'fileConsent/invoke'. Handlers registered here run before
|
58 | * `handleTeamsFileConsentAccept` and `handleTeamsFileConsentDecline`.
|
59 | * Developers are not passed a pointer to the next `handleTeamsFileConsent` handler because the _wrapper_ around
|
60 | * the handler will call `onDialogs` handlers after delegating to `handleTeamsFileConsentAccept` or `handleTeamsFileConsentDecline`.
|
61 | *
|
62 | * @param context A context object for this turn.
|
63 | * @param fileConsentCardResponse Represents the value of the invoke activity sent when the user acts on a file consent card.
|
64 | * @returns A promise that represents the work queued.
|
65 | */
|
66 | protected handleTeamsFileConsent(context: TurnContext, fileConsentCardResponse: FileConsentCardResponse): Promise<void>;
|
67 | /**
|
68 | * Receives invoke activities with Activity name of 'fileConsent/invoke' with confirmation from user
|
69 | *
|
70 | * @remarks
|
71 | * This type of invoke activity occur during the File Consent flow.
|
72 | * @param _context A context object for this turn.
|
73 | * @param _fileConsentCardResponse Represents the value of the invoke activity sent when the user acts on a file consent card.
|
74 | * @returns A promise that represents the work queued.
|
75 | */
|
76 | protected handleTeamsFileConsentAccept(_context: TurnContext, _fileConsentCardResponse: FileConsentCardResponse): Promise<void>;
|
77 | /**
|
78 | * Receives invoke activities with Activity name of 'fileConsent/invoke' with decline from user
|
79 | *
|
80 | * @remarks
|
81 | * This type of invoke activity occur during the File Consent flow.
|
82 | * @param _context A context object for this turn.
|
83 | * @param _fileConsentCardResponse Represents the value of the invoke activity sent when the user acts on a file consent card.
|
84 | * @returns A promise that represents the work queued.
|
85 | */
|
86 | protected handleTeamsFileConsentDecline(_context: TurnContext, _fileConsentCardResponse: FileConsentCardResponse): Promise<void>;
|
87 | /**
|
88 | * Receives invoke activities with Activity name of 'actionableMessage/executeAction'.
|
89 | *
|
90 | * @param _context A context object for this turn.
|
91 | * @param _query The O365 connector card HttpPOST invoke query.
|
92 | * @returns A promise that represents the work queued.
|
93 | */
|
94 | protected handleTeamsO365ConnectorCardAction(_context: TurnContext, _query: O365ConnectorCardActionQuery): Promise<void>;
|
95 | /**
|
96 | * Invoked when a signIn invoke activity is received from the connector.
|
97 | *
|
98 | * @param context A context object for this turn.
|
99 | * @returns A promise that represents the work queued.
|
100 | */
|
101 | protected onSignInInvoke(context: TurnContext): Promise<void>;
|
102 | /**
|
103 | * Receives invoke activities with Activity name of 'signin/verifyState'.
|
104 | *
|
105 | * @param _context A context object for this turn.
|
106 | * @param _query Signin state (part of signin action auth flow) verification invoke query.
|
107 | * @returns A promise that represents the work queued.
|
108 | */
|
109 | protected handleTeamsSigninVerifyState(_context: TurnContext, _query: SigninStateVerificationQuery): Promise<void>;
|
110 | /**
|
111 | * Receives invoke activities with Activity name of 'signin/tokenExchange'
|
112 | *
|
113 | * @param _context A context object for this turn.
|
114 | * @param _query Signin state (part of signin action auth flow) verification invoke query
|
115 | * @returns A promise that represents the work queued.
|
116 | */
|
117 | protected handleTeamsSigninTokenExchange(_context: TurnContext, _query: SigninStateVerificationQuery): Promise<void>;
|
118 | /**
|
119 | * Receives invoke activities with Activity name of 'composeExtension/onCardButtonClicked'
|
120 | *
|
121 | * @param _context A context object for this turn.
|
122 | * @param _cardData Object representing the card data.
|
123 | * @returns A promise that represents the work queued.
|
124 | */
|
125 | protected handleTeamsMessagingExtensionCardButtonClicked(_context: TurnContext, _cardData: any): Promise<void>;
|
126 | /**
|
127 | * Receives invoke activities with Activity name of 'task/fetch'
|
128 | *
|
129 | * @param _context A context object for this turn.
|
130 | * @param _taskModuleRequest The task module invoke request value payload.
|
131 | * @returns A Task Module Response for the request.
|
132 | */
|
133 | protected handleTeamsTaskModuleFetch(_context: TurnContext, _taskModuleRequest: TaskModuleRequest): Promise<TaskModuleResponse>;
|
134 | /**
|
135 | * Receives invoke activities with Activity name of 'task/submit'
|
136 | *
|
137 | * @param _context A context object for this turn.
|
138 | * @param _taskModuleRequest The task module invoke request value payload.
|
139 | * @returns A Task Module Response for the request.
|
140 | */
|
141 | protected handleTeamsTaskModuleSubmit(_context: TurnContext, _taskModuleRequest: TaskModuleRequest): Promise<TaskModuleResponse>;
|
142 | /**
|
143 | * Receives invoke activities with Activity name of 'tab/fetch'
|
144 | *
|
145 | * @param _context A context object for this turn.
|
146 | * @param _tabRequest The tab invoke request value payload.
|
147 | * @returns A Tab Response for the request.
|
148 | */
|
149 | protected handleTeamsTabFetch(_context: TurnContext, _tabRequest: TabRequest): Promise<TabResponse>;
|
150 | /**
|
151 | * Receives invoke activities with Activity name of 'tab/submit'
|
152 | *
|
153 | * @param _context A context object for this turn.
|
154 | * @param _tabSubmit The tab submit invoke request value payload.
|
155 | * @returns A Tab Response for the request.
|
156 | */
|
157 | protected handleTeamsTabSubmit(_context: TurnContext, _tabSubmit: TabSubmit): Promise<TabResponse>;
|
158 | /**
|
159 | * Receives invoke activities with Activity name of 'composeExtension/queryLink'
|
160 | *
|
161 | * @remarks
|
162 | * Used in creating a Search-based Message Extension.
|
163 | * @param _context A context object for this turn.
|
164 | * @param _query he invoke request body type for app-based link query.
|
165 | * @returns The Messaging Extension Response for the query.
|
166 | */
|
167 | protected handleTeamsAppBasedLinkQuery(_context: TurnContext, _query: AppBasedLinkQuery): Promise<MessagingExtensionResponse>;
|
168 | /**
|
169 | * Receives invoke activities with Activity name of 'composeExtension/anonymousQueryLink'
|
170 | *
|
171 | * @remarks
|
172 | * Used in creating a Search-based Message Extension.
|
173 | * @param _context A context object for this turn.
|
174 | * @param _query he invoke request body type for app-based link query.
|
175 | * @returns The Messaging Extension Response for the query.
|
176 | */
|
177 | protected handleTeamsAnonymousAppBasedLinkQuery(_context: TurnContext, _query: AppBasedLinkQuery): Promise<MessagingExtensionResponse>;
|
178 | /**
|
179 | * Receives invoke activities with the name 'composeExtension/query'.
|
180 | *
|
181 | * @remarks
|
182 | * Used in creating a Search-based Message Extension.
|
183 | * @param _context A context object for this turn.
|
184 | * @param _query The query for the search command.
|
185 | * @returns The Messaging Extension Response for the query.
|
186 | */
|
187 | protected handleTeamsMessagingExtensionQuery(_context: TurnContext, _query: MessagingExtensionQuery): Promise<MessagingExtensionResponse>;
|
188 | /**
|
189 | * Receives invoke activities with the name 'composeExtension/selectItem'.
|
190 | *
|
191 | * @remarks
|
192 | * Used in creating a Search-based Message Extension.
|
193 | * @param _context A context object for this turn.
|
194 | * @param _query The object representing the query.
|
195 | * @returns The Messaging Extension Response for the query.
|
196 | */
|
197 | protected handleTeamsMessagingExtensionSelectItem(_context: TurnContext, _query: any): Promise<MessagingExtensionResponse>;
|
198 | /**
|
199 | * Receives invoke activities with the name 'composeExtension/submitAction' and dispatches to botMessagePreview-flows as applicable.
|
200 | *
|
201 | * @remarks
|
202 | * A handler registered through this method does not dispatch to the next handler (either `handleTeamsMessagingExtensionSubmitAction`, `handleTeamsMessagingExtensionBotMessagePreviewEdit`, or `handleTeamsMessagingExtensionBotMessagePreviewSend`).
|
203 | * This method exists for developers to optionally add more logic before the TeamsActivityHandler routes the activity to one of the
|
204 | * previously mentioned handlers.
|
205 | * @param context A context object for this turn.
|
206 | * @param action The messaging extension action.
|
207 | * @returns The Messaging Extension Action Response for the action.
|
208 | */
|
209 | protected handleTeamsMessagingExtensionSubmitActionDispatch(context: TurnContext, action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
210 | /**
|
211 | * Receives invoke activities with the name 'composeExtension/submitAction'.
|
212 | *
|
213 | * @param _context A context object for this turn.
|
214 | * @param _action The messaging extension action.
|
215 | * @returns The Messaging Extension Action Response for the action.
|
216 | */
|
217 | protected handleTeamsMessagingExtensionSubmitAction(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
218 | /**
|
219 | * Receives invoke activities with the name 'composeExtension/submitAction' with the 'botMessagePreview' property present on activity.value.
|
220 | * The value for 'botMessagePreview' is 'edit'.
|
221 | *
|
222 | * @param _context A context object for this turn.
|
223 | * @param _action The messaging extension action.
|
224 | * @returns The Messaging Extension Action Response for the action.
|
225 | */
|
226 | protected handleTeamsMessagingExtensionBotMessagePreviewEdit(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
227 | /**
|
228 | * Receives invoke activities with the name 'composeExtension/submitAction' with the 'botMessagePreview' property present on activity.value.
|
229 | * The value for 'botMessagePreview' is 'send'.
|
230 | *
|
231 | * @param _context A context object for this turn.
|
232 | * @param _action The messaging extension action.
|
233 | * @returns The Messaging Extension Action Response for the action.
|
234 | */
|
235 | protected handleTeamsMessagingExtensionBotMessagePreviewSend(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
236 | /**
|
237 | * Receives invoke activities with the name 'composeExtension/fetchTask'
|
238 | *
|
239 | * @param _context A context object for this turn.
|
240 | * @param _action The messaging extension action.
|
241 | * @returns The Messaging Extension Action Response for the action.
|
242 | */
|
243 | protected handleTeamsMessagingExtensionFetchTask(_context: TurnContext, _action: MessagingExtensionAction): Promise<MessagingExtensionActionResponse>;
|
244 | /**
|
245 | * Receives invoke activities with the name 'composeExtension/querySettingUrl'
|
246 | *
|
247 | * @param _context A context object for this turn.
|
248 | * @param _query The Messaging extension query.
|
249 | * @returns The Messaging Extension Action Response for the query.
|
250 | */
|
251 | protected handleTeamsMessagingExtensionConfigurationQuerySettingUrl(_context: TurnContext, _query: MessagingExtensionQuery): Promise<MessagingExtensionResponse>;
|
252 | /**
|
253 | * Receives invoke activities with the name 'composeExtension/setting'
|
254 | *
|
255 | * @param _context A context object for this turn.
|
256 | * @param _settings Object representing the configuration settings.
|
257 | */
|
258 | protected handleTeamsMessagingExtensionConfigurationSetting(_context: TurnContext, _settings: any): Promise<void>;
|
259 | /**
|
260 | * Override this method to change the dispatching of ConversationUpdate activities.
|
261 | *
|
262 | * @param context A context object for this turn.
|
263 | * @returns A promise that represents the work queued.
|
264 | */
|
265 | protected dispatchConversationUpdateActivity(context: TurnContext): Promise<void>;
|
266 | /**
|
267 | * Override this method to change the dispatching of MessageUpdate activities.
|
268 | *
|
269 | * @param context A context object for this turn.
|
270 | * @returns A promise that represents the work queued.
|
271 | */
|
272 | protected dispatchMessageUpdateActivity(context: TurnContext): Promise<void>;
|
273 | /**
|
274 | * Override this method to change the dispatching of MessageDelete activities.
|
275 | *
|
276 | * @param context A context object for this turn.
|
277 | * @returns A promise that represents the work queued.
|
278 | */
|
279 | protected dispatchMessageDeleteActivity(context: TurnContext): Promise<void>;
|
280 | /**
|
281 | * Called in `dispatchMessageUpdateActivity()` to trigger the `'TeamsMessageUndelete'` handlers.
|
282 | * Override this in a derived class to provide logic for when a deleted message in a conversation is undeleted.
|
283 | * For example, when the user decides to "undo" a deleted message.
|
284 | *
|
285 | * @param context A context object for this turn.
|
286 | * @returns A promise that represents the work queued.
|
287 | */
|
288 | protected onTeamsMessageUndelete(context: TurnContext): Promise<void>;
|
289 | /**
|
290 | * Called in `dispatchMessageUpdateActivity()` to trigger the `'TeamsMessageEdit'` handlers.
|
291 | * Override this in a derived class to provide logic for when a message in a conversation is edited.
|
292 | *
|
293 | * @param context A context object for this turn.
|
294 | * @returns A promise that represents the work queued.
|
295 | */
|
296 | protected onTeamsMessageEdit(context: TurnContext): Promise<void>;
|
297 | /**
|
298 | * Called in `dispatchMessageDeleteActivity()` to trigger the `'TeamsMessageEdit'` handlers.
|
299 | * Override this in a derived class to provide logic for when a message in a conversation is soft deleted.
|
300 | * This means that the message as the option of being undeleted.
|
301 | *
|
302 | * @param context A context object for this turn.
|
303 | * @returns A promise that represents the work queued.
|
304 | */
|
305 | protected onTeamsMessageSoftDelete(context: TurnContext): Promise<void>;
|
306 | /**
|
307 | * Called in `dispatchConversationUpdateActivity()` to trigger the `'TeamsMembersAdded'` handlers.
|
308 | * Override this in a derived class to provide logic for when members other than the bot
|
309 | * join the channel, such as your bot's welcome logic.
|
310 | *
|
311 | * @remarks
|
312 | * If no handlers are registered for the `'TeamsMembersAdded'` event, the `'MembersAdded'` handlers will run instead.
|
313 | * @param context A context object for this turn.
|
314 | * @returns A promise that represents the work queued.
|
315 | */
|
316 | protected onTeamsMembersAdded(context: TurnContext): Promise<void>;
|
317 | /**
|
318 | * Called in `dispatchConversationUpdateActivity()` to trigger the `'TeamsMembersRemoved'` handlers.
|
319 | * Override this in a derived class to provide logic for when members other than the bot
|
320 | * leave the channel, such as your bot's good-bye logic.
|
321 | *
|
322 | * @remarks
|
323 | * If no handlers are registered for the `'TeamsMembersRemoved'` event, the `'MembersRemoved'` handlers will run instead.
|
324 | * @param context A context object for this turn.
|
325 | * @returns A promise that represents the work queued.
|
326 | */
|
327 | protected onTeamsMembersRemoved(context: TurnContext): Promise<void>;
|
328 | /**
|
329 | * Invoked when a Channel Created event activity is received from the connector.
|
330 | * Channel Created corresponds to the user creating a new channel.
|
331 | * Override this in a derived class to provide logic for when a channel is created.
|
332 | *
|
333 | * @param context A context object for this turn.
|
334 | * @returns A promise that represents the work queued.
|
335 | */
|
336 | protected onTeamsChannelCreated(context: TurnContext): Promise<void>;
|
337 | /**
|
338 | * Invoked when a Channel Deleted event activity is received from the connector.
|
339 | * Channel Deleted corresponds to the user deleting a channel.
|
340 | * Override this in a derived class to provide logic for when a channel is deleted.
|
341 | *
|
342 | * @param context A context object for this turn.
|
343 | * @returns A promise that represents the work queued.
|
344 | */
|
345 | protected onTeamsChannelDeleted(context: TurnContext): Promise<void>;
|
346 | /**
|
347 | * Invoked when a Channel Renamed event activity is received from the connector.
|
348 | * Channel Renamed corresponds to the user renaming a new channel.
|
349 | * Override this in a derived class to provide logic for when a channel is renamed.
|
350 | *
|
351 | * @param context A context object for this turn.
|
352 | * @returns A promise that represents the work queued.
|
353 | */
|
354 | protected onTeamsChannelRenamed(context: TurnContext): Promise<void>;
|
355 | /**
|
356 | * Invoked when a Team Archived event activity is received from the connector.
|
357 | * Team Archived corresponds to the user archiving a team.
|
358 | * Override this in a derived class to provide logic for when a team is archived.
|
359 | *
|
360 | * @param context The context for this turn.
|
361 | * @returns A promise that represents the work queued.
|
362 | */
|
363 | protected onTeamsTeamArchived(context: TurnContext): Promise<void>;
|
364 | /**
|
365 | * Invoked when a Team Deleted event activity is received from the connector.
|
366 | * Team Deleted corresponds to the user deleting a team.
|
367 | * Override this in a derived class to provide logic for when a team is deleted.
|
368 | *
|
369 | * @param context The context for this turn.
|
370 | * @returns A promise that represents the work queued.
|
371 | */
|
372 | protected onTeamsTeamDeleted(context: TurnContext): Promise<void>;
|
373 | /**
|
374 | * Invoked when a Team Hard Deleted event activity is received from the connector.
|
375 | * Team Hard Deleted corresponds to the user hard-deleting a team.
|
376 | * Override this in a derived class to provide logic for when a team is hard-deleted.
|
377 | *
|
378 | * @param context The context for this turn.
|
379 | * @returns A promise that represents the work queued.
|
380 | */
|
381 | protected onTeamsTeamHardDeleted(context: TurnContext): Promise<void>;
|
382 | /**
|
383 | *
|
384 | * Invoked when a Channel Restored event activity is received from the connector.
|
385 | * Channel Restored corresponds to the user restoring a previously deleted channel.
|
386 | * Override this in a derived class to provide logic for when a channel is restored.
|
387 | *
|
388 | * @param context The context for this turn.
|
389 | * @returns A promise that represents the work queued.
|
390 | */
|
391 | protected onTeamsChannelRestored(context: TurnContext): Promise<void>;
|
392 | /**
|
393 | * Invoked when a Team Renamed event activity is received from the connector.
|
394 | * Team Renamed corresponds to the user renaming a team.
|
395 | * Override this in a derived class to provide logic for when a team is renamed.
|
396 | *
|
397 | * @param context The context for this turn.
|
398 | * @returns A promise that represents the work queued.
|
399 | */
|
400 | protected onTeamsTeamRenamed(context: TurnContext): Promise<void>;
|
401 | /**
|
402 | * Invoked when a Team Restored event activity is received from the connector.
|
403 | * Team Restored corresponds to the user restoring a team.
|
404 | * Override this in a derived class to provide logic for when a team is restored.
|
405 | *
|
406 | * @param context The context for this turn.
|
407 | * @returns A promise that represents the work queued.
|
408 | */
|
409 | protected onTeamsTeamRestored(context: TurnContext): Promise<void>;
|
410 | /**
|
411 | * Invoked when a Team Unarchived event activity is received from the connector.
|
412 | * Team Unarchived corresponds to the user unarchiving a team.
|
413 | * Override this in a derived class to provide logic for when a team is unarchived.
|
414 | *
|
415 | * @param context The context for this turn.
|
416 | * @returns A promise that represents the work queued.
|
417 | */
|
418 | protected onTeamsTeamUnarchived(context: TurnContext): Promise<void>;
|
419 | /**
|
420 | * Registers a handler for TeamsMessageUndelete events, such as for when a message in a conversation that is
|
421 | * observed by the bot goes from a soft delete state to the normal state.
|
422 | *
|
423 | * @param handler A callback to handle the teams undelete message event.
|
424 | * @returns A promise that represents the work queued.
|
425 | */
|
426 | onTeamsMessageUndeleteEvent(handler: (context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
427 | /**
|
428 | * Registers a handler for TeamsMessageEdit events, such as for when a message in a conversation that is
|
429 | * observed by the bot is edited.
|
430 | *
|
431 | * @param handler A callback to handle the teams edit message event.
|
432 | * @returns A promise that represents the work queued.
|
433 | */
|
434 | onTeamsMessageEditEvent(handler: (context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
435 | /**
|
436 | * Registers a handler for TeamsMessageSoftDelete events, such as for when a message in a conversation that is
|
437 | * observed by the bot is soft deleted. This means that the deleted message, up to a certain time period,
|
438 | * can be undoed.
|
439 | *
|
440 | * @param handler A callback to handle the teams edit message event.
|
441 | * @returns A promise that represents the work queued.
|
442 | */
|
443 | onTeamsMessageSoftDeleteEvent(handler: (context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
444 | /**
|
445 | * Registers a handler for TeamsMembersAdded events, such as for when members other than the bot
|
446 | * join the channel, such as your bot's welcome logic.
|
447 | *
|
448 | * @param handler A callback to handle the teams members added event.
|
449 | * @returns A promise that represents the work queued.
|
450 | */
|
451 | onTeamsMembersAddedEvent(handler: (membersAdded: TeamsChannelAccount[], teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
452 | /**
|
453 | * Registers a handler for TeamsMembersRemoved events, such as for when members other than the bot
|
454 | * leave the channel, such as your bot's good-bye logic.
|
455 | *
|
456 | * @param handler A callback to handle the teams members removed event.
|
457 | * @returns A promise that represents the work queued.
|
458 | */
|
459 | onTeamsMembersRemovedEvent(handler: (membersRemoved: TeamsChannelAccount[], teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
460 | /**
|
461 | * Registers a handler for TeamsChannelCreated events, such as for when a channel is created.
|
462 | *
|
463 | * @param handler A callback to handle the teams channel created event.
|
464 | * @returns A promise that represents the work queued.
|
465 | */
|
466 | onTeamsChannelCreatedEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
467 | /**
|
468 | * Registers a handler for TeamsChannelDeleted events, such as for when a channel is deleted.
|
469 | *
|
470 | * @param handler A callback to handle the teams channel deleted event.
|
471 | * @returns A promise that represents the work queued.
|
472 | */
|
473 | onTeamsChannelDeletedEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
474 | /**
|
475 | * Registers a handler for TeamsChannelRenamed events, such as for when a channel is renamed.
|
476 | *
|
477 | * @param handler A callback to handle the teams channel renamed event.
|
478 | * @returns A promise that represents the work queued.
|
479 | */
|
480 | onTeamsChannelRenamedEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
481 | /**
|
482 | * Registers a handler for TeamsTeamArchived events, such as for when a team is archived.
|
483 | *
|
484 | * @param handler A callback to handle the teams team archived event.
|
485 | * @returns A promise that represents the work queued.
|
486 | */
|
487 | onTeamsTeamArchivedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
488 | /**
|
489 | * Registers a handler for TeamsTeamDeleted events, such as for when a team is deleted.
|
490 | *
|
491 | * @param handler A callback to handle the teams team deleted event.
|
492 | * @returns A promise that represents the work queued.
|
493 | */
|
494 | onTeamsTeamDeletedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
495 | /**
|
496 | * Registers a handler for TeamsTeamHardDeleted events, such as for when a team is hard-deleted.
|
497 | *
|
498 | * @param handler A callback to handle the teams team hard deleted event.
|
499 | * @returns A promise that represents the work queued.
|
500 | */
|
501 | onTeamsTeamHardDeletedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
502 | /**
|
503 | * Registers a handler for TeamsChannelRestored events, such as for when a channel is restored.
|
504 | *
|
505 | * @param handler A callback to handle the teams channel restored event.
|
506 | * @returns A promise that represents the work queued.
|
507 | */
|
508 | onTeamsChannelRestoredEvent(handler: (channelInfo: ChannelInfo, teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
509 | /**
|
510 | * Registers a handler for TeamsTeamRenamed events, such as for when a team is renamed.
|
511 | *
|
512 | * @param handler A callback to handle the teams team renamed event.
|
513 | * @returns A promise that represents the work queued.
|
514 | */
|
515 | onTeamsTeamRenamedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
516 | /**
|
517 | * Registers a handler for TeamsTeamRestored events, such as for when a team is restored.
|
518 | *
|
519 | * @param handler A callback to handle the teams team restored event.
|
520 | * @returns A promise that represents the work queued.
|
521 | */
|
522 | onTeamsTeamRestoredEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
523 | /**
|
524 | * Registers a handler for TeamsTeamUnarchived events, such as for when a team is unarchived.
|
525 | *
|
526 | * @param handler A callback to handle the teams team unarchived event.
|
527 | * @returns A promise that represents the work queued.
|
528 | */
|
529 | onTeamsTeamUnarchivedEvent(handler: (teamInfo: TeamInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
530 | /**
|
531 | * Runs the _event_ sub-type handlers, as appropriate, and then continues the event emission process.
|
532 | *
|
533 | * @param context The context object for the current turn.
|
534 | * @returns A promise that represents the work queued.
|
535 | *
|
536 | * @remarks
|
537 | * Override this method to support channel-specific behavior across multiple channels or to add
|
538 | * custom event sub-type events.
|
539 | */
|
540 | protected dispatchEventActivity(context: TurnContext): Promise<void>;
|
541 | /**
|
542 | * Invoked when a Meeting Started event activity is received from the connector.
|
543 | * Override this in a derived class to provide logic for when a meeting is started.
|
544 | *
|
545 | * @param context The context for this turn.
|
546 | * @returns A promise that represents the work queued.
|
547 | */
|
548 | protected onTeamsMeetingStart(context: TurnContext): Promise<void>;
|
549 | /**
|
550 | * Invoked when a Meeting End event activity is received from the connector.
|
551 | * Override this in a derived class to provide logic for when a meeting is ended.
|
552 | *
|
553 | * @param context The context for this turn.
|
554 | * @returns A promise that represents the work queued.
|
555 | */
|
556 | protected onTeamsMeetingEnd(context: TurnContext): Promise<void>;
|
557 | /**
|
558 | * Invoked when a read receipt for a previously sent message is received from the connector.
|
559 | * Override this in a derived class to provide logic for when the bot receives a read receipt event.
|
560 | *
|
561 | * @param context The context for this turn.
|
562 | * @returns A promise that represents the work queued.
|
563 | */
|
564 | protected onTeamsReadReceipt(context: TurnContext): Promise<void>;
|
565 | /**
|
566 | * Invoked when a Meeting Participant Join event activity is received from the connector.
|
567 | * Override this in a derived class to provide logic for when a meeting participant is joined.
|
568 | *
|
569 | * @param context The context for this turn.
|
570 | * @returns A promise that represents the work queued.
|
571 | */
|
572 | protected onTeamsMeetingParticipantsJoin(context: TurnContext): Promise<void>;
|
573 | /**
|
574 | * Invoked when a Meeting Participant Leave event activity is received from the connector.
|
575 | * Override this in a derived class to provide logic for when a meeting participant is left.
|
576 | *
|
577 | * @param context The context for this turn.
|
578 | * @returns A promise that represents the work queued.
|
579 | */
|
580 | protected onTeamsMeetingParticipantsLeave(context: TurnContext): Promise<void>;
|
581 | /**
|
582 | * Registers a handler for when a Teams meeting starts.
|
583 | *
|
584 | * @param handler A callback that handles Meeting Start events.
|
585 | * @returns A promise that represents the work queued.
|
586 | */
|
587 | onTeamsMeetingStartEvent(handler: (meeting: MeetingStartEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
588 | /**
|
589 | * Registers a handler for when a Teams meeting ends.
|
590 | *
|
591 | * @param handler A callback that handles Meeting End events.
|
592 | * @returns A promise that represents the work queued.
|
593 | */
|
594 | onTeamsMeetingEndEvent(handler: (meeting: MeetingEndEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
595 | /**
|
596 | * Registers a handler for when a Read Receipt is sent.
|
597 | *
|
598 | * @param handler A callback that handles Read Receipt events.
|
599 | * @returns A promise that represents the work queued.
|
600 | */
|
601 | onTeamsReadReceiptEvent(handler: (receiptInfo: ReadReceiptInfo, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
602 | /**
|
603 | * Registers a handler for when a Teams meeting participant join.
|
604 | *
|
605 | * @param handler A callback that handles Meeting Participant Join events.
|
606 | * @returns A promise that represents the work queued.
|
607 | */
|
608 | onTeamsMeetingParticipantsJoinEvent(handler: (meeting: MeetingParticipantsEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
609 | /**
|
610 | * Registers a handler for when a Teams meeting participant leave.
|
611 | *
|
612 | * @param handler A callback that handles Meeting Participant Leave events.
|
613 | * @returns A promise that represents the work queued.
|
614 | */
|
615 | onTeamsMeetingParticipantsLeaveEvent(handler: (meeting: MeetingParticipantsEventDetails, context: TurnContext, next: () => Promise<void>) => Promise<void>): this;
|
616 | }
|
617 | //# sourceMappingURL=teamsActivityHandler.d.ts.map |
\ | No newline at end of file |