This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Global, Module } from '@nestjs/common'; | |
| import { Botbuilder } from './common.bot.builder'; | |
| import { BotConnector } from './common.bot.connector'; | |
| @Global() | |
| @Module({ | |
| components: [Botbuilder, BotConnector], | |
| exports: [Botbuilder, BotConnector] | |
| }) | |
| export class BotCommonModule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Module } from '@nestjs/common'; | |
| import { HelpDialog } from './help.dialog'; | |
| @Module({ | |
| components: [HelpDialog], | |
| exports: [HelpDialog] | |
| }) | |
| export class HelpDialogModule | |
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Module } from '@nestjs/common'; | |
| import { GreetingsDialog } from './greetings.dialog'; | |
| @Module({ | |
| components: [GreetingsDialog], | |
| exports: [GreetingsDialog] | |
| }) | |
| export class GreetingsDialogModule {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Module } from '@nestjs/common'; | |
| import { GreetingsDialogModule } from './greetings/greetings.module'; | |
| import { HelpDialogModule } from './help/help.module'; | |
| @Module({ | |
| imports: [GreetingsDialogModule, HelpDialogModule] | |
| }) | |
| export class DialogsModule {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Module, MiddlewaresConsumer, NestModule } from '@nestjs/common'; | |
| import { MessagesController } from './messages.controller'; | |
| import { MessagesMiddleware } from './messages.middleware'; | |
| @Module({ | |
| controllers: [MessagesController] | |
| }) | |
| export class MessagesModule implements NestModule{ | |
| configure(consumer: MiddlewaresConsumer): void { | |
| consumer.apply(MessagesMiddleware).forRoutes(MessagesController); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@nestjs/common'; | |
| import * as builder from 'botbuilder'; | |
| import { Botbuilder } from '../../common/common.bot.builder'; | |
| @Component() | |
| export class HelpDialog { | |
| private dialogId: string = 'help'; | |
| constructor(private readonly botBuilder: Botbuilder) { | |
| botBuilder.bot.dialog(this.dialogId, this.dialog).triggerAction({ matches: /^help/i }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {IDialogWaterfallStep} from 'botbuilder/lib/botbuilder'; | |
| import { Component } from '@nestjs/common'; | |
| import * as builder from 'botbuilder'; | |
| import { Botbuilder } from '../../common/common.bot.builder'; | |
| @Component() | |
| export class GreetingsDialog { | |
| private dialogId: string = 'greetings'; | |
| constructor(private readonly botBuilder: Botbuilder) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Module } from '@nestjs/common'; | |
| import { BotModule } from './bot/bot.module'; | |
| @Module({ | |
| imports: [BotModule] | |
| }) | |
| export class ApplicationModule {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@nestjs/common'; | |
| import * as builder from 'botbuilder'; | |
| @Component() | |
| export class BotConnector { | |
| connector: builder.ChatConnector; | |
| constructor() { | |
| this.connector = new builder.ChatConnector({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Middleware, NestMiddleware, ExpressMiddleware } from '@nestjs/common'; | |
| import { BotConnector } from '../common/common.bot.connector'; | |
| @Middleware() | |
| export class MessagesMiddleware implements NestMiddleware { | |
| connectorListener; | |
| constructor(private readonly botConnector: BotConnector) { | |
| this.connectorListener = botConnector.connector.listen(); | |
| } |
NewerOlder