Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update activityHandler.ts #1620

Merged
merged 4 commits into from
Feb 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions libraries/botbuilder-core/src/activityHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export type BotHandler = (context: TurnContext, next: () => Promise<void>) => Pr
* | Turn | Emitted first for every activity. |
* | Type-specific | Emitted for the specific activity type, before emitting an event for any sub-type. |
* | Sub-type | Emitted for certain specialized events, based on activity content. |
* | Dialog | Emitted as the final activity processing event. Designed for passing control to a dialog. |
* | Dialog | Emitted as the final activity processing event. |
*
* For example:
*
Expand All @@ -54,7 +54,7 @@ export type BotHandler = (context: TurnContext, next: () => Promise<void>) => Pr
*
* server.post('/api/messages', (req, res) => {
* adapter.processActivity(req, res, async (context) => {
* // Route to main dialog.
* // Route to bot's activity logic.
* await bot.run(context);
* });
* });
Expand Down Expand Up @@ -300,18 +300,6 @@ export class ActivityHandler extends ActivityHandlerBase {
* @remarks
* Returns a reference to the [ActivityHandler](xref:botbuilder-core.ActivityHandler) object.
*
* For example:
* ```javascript
* bot.onDialog(async (context, next) => {
* if (context.activity.type === ActivityTypes.Message) {
* const dialogContext = await dialogSet.createContext(context);
* const results = await dialogContext.continueDialog();
* await conversationState.saveChanges(context);
* }
*
* await next();
* });
* ```
*/
public onDialog(handler: BotHandler): this {
return this.on('Dialog', handler);
Expand All @@ -331,7 +319,7 @@ export class ActivityHandler extends ActivityHandlerBase {
* ```javascript
* server.post('/api/messages', (req, res) => {
* adapter.processActivity(req, res, async (context) => {
* // Route to main dialog.
* // Route to bot's activity logic.
* await bot.run(context);
* });
* });
Expand Down