mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2026-10-20 13:17:07 +03:00
feat(): add sample app
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TelegrafModule } from '../lib';
|
||||
import { AppUpdate } from './app.update';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TelegrafModule.forRoot({
|
||||
token: '1467731595:AAHCvH65H9VQYKF9jE-E8c2rXsQBVAYseg8',
|
||||
}),
|
||||
],
|
||||
providers: [AppUpdate],
|
||||
})
|
||||
export class AppModule {}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { On, Update } from '../lib/decorators';
|
||||
|
||||
@Update()
|
||||
export class AppUpdate {
|
||||
@On('message')
|
||||
onMessage(): void {
|
||||
console.log('New message received');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
async function bootstrap() {
|
||||
await NestFactory.createApplicationContext(AppModule);
|
||||
}
|
||||
bootstrap();
|
||||
Reference in New Issue
Block a user