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 { UniversalBot } from 'botbuilder/lib/botbuilder'; | |
| import * as builder from 'botbuilder'; | |
| import { BotConnector } from './common.bot.connector'; | |
| @Component() | |
| export class Botbuilder { | |
| bot: UniversalBot; | |
| constructor(private readonly botConnector: BotConnector) { |
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, NestModule } from "@nestjs/common"; | |
| import { BotCommonModule } from "./common/common.bot.module"; | |
| import { MessagesModule } from "./messages/messages.module"; | |
| @Module({ | |
| imports: [BotCommonModule, MessagesModule], | |
| }) | |
| export class BotModule { } |
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 { Controller, Get, Post } from '@nestjs/common'; | |
| @Controller('api/messages') | |
| export class MessagesController { | |
| @Post() | |
| listen() { } | |
| } |
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(); | |
| } |
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 { 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 {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 { 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 { 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 { Module } from '@nestjs/common'; | |
| import { GreetingsDialogModule } from './greetings/greetings.module'; | |
| import { HelpDialogModule } from './help/help.module'; | |
| @Module({ | |
| imports: [GreetingsDialogModule, HelpDialogModule] | |
| }) | |
| export class DialogsModule {} |
OlderNewer