feat(sample-app): use include feature

This commit is contained in:
Morb0
2021-01-03 14:26:32 +03:00
parent 82a9c259f6
commit 334304a823
8 changed files with 47 additions and 24 deletions

View File

@@ -0,0 +1,7 @@
import { Module } from '@nestjs/common';
import { GreeterUpdate } from './greeter.update';
@Module({
providers: [GreeterUpdate],
})
export class GreeterModule {}

View File

@@ -0,0 +1,12 @@
import { Injectable } from '@nestjs/common';
import { Hears } from '../../lib';
import { Context } from '../interfaces/context.interface';
@Injectable()
export class GreeterUpdate {
@Hears(['hi', 'hello', 'hey', 'qq'])
async onGreetings(ctx: Context): Promise<void> {
const { first_name } = ctx.from;
await ctx.reply(`Hey ${first_name}`);
}
}