mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-23 14:42:59 +03:00
fix(sample): use new options
This commit is contained in:
parent
751b15b4b2
commit
f8872663d8
@ -23,12 +23,12 @@
|
||||
"@nestjs/common": "7.5.1",
|
||||
"@nestjs/core": "7.5.1",
|
||||
"@nestjs/platform-express": "7.5.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"dotenv": "8.2.0",
|
||||
"nestjs-telegraf": "*",
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rimraf": "3.0.2",
|
||||
"rxjs": "6.6.3",
|
||||
"telegraf": "^3.38.0"
|
||||
"telegraf": "3.38.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "7.5.1",
|
||||
|
@ -12,11 +12,13 @@ import { GreeterBotName } from './app.constants';
|
||||
middlewares: [sessionMiddleware],
|
||||
include: [EchoModule],
|
||||
}),
|
||||
TelegrafModule.forRoot({
|
||||
name: GreeterBotName,
|
||||
token: process.env.GREETER_BOT_TOKEN,
|
||||
middlewares: [sessionMiddleware],
|
||||
include: [GreeterModule],
|
||||
TelegrafModule.forRootAsync({
|
||||
botName: GreeterBotName,
|
||||
useFactory: () => ({
|
||||
token: process.env.GREETER_BOT_TOKEN,
|
||||
middlewares: [sessionMiddleware],
|
||||
include: [GreeterModule],
|
||||
}),
|
||||
}),
|
||||
EchoModule,
|
||||
GreeterModule,
|
||||
|
@ -1,13 +1,21 @@
|
||||
import { Telegraf } from 'telegraf';
|
||||
import { Command, Help, InjectBot, On, Start, Update } from 'nestjs-telegraf';
|
||||
import {
|
||||
Command,
|
||||
getBotToken,
|
||||
Help,
|
||||
InjectBot,
|
||||
On,
|
||||
Start,
|
||||
Update,
|
||||
} from 'nestjs-telegraf';
|
||||
import { EchoService } from './echo.service';
|
||||
import { HELLO_SCENE_ID } from '../app.constants';
|
||||
import { GreeterBotName, HELLO_SCENE_ID } from '../app.constants';
|
||||
import { Context } from '../interfaces/context.interface';
|
||||
|
||||
@Update()
|
||||
export class EchoUpdate {
|
||||
constructor(
|
||||
@InjectBot()
|
||||
@InjectBot(GreeterBotName)
|
||||
private readonly bot: Telegraf<Context>,
|
||||
private readonly echoService: EchoService,
|
||||
) {}
|
||||
|
Loading…
Reference in New Issue
Block a user