fix(sample): use update decorator for greeter

This commit is contained in:
Morb0 2021-01-03 16:21:25 +03:00
parent 8fcec73afd
commit 4420e01d8a

View File

@ -1,9 +1,13 @@
import { Injectable } from '@nestjs/common';
import { Hears } from '../../lib';
import { Hears, Start, Update } from '../../lib';
import { Context } from '../interfaces/context.interface';
@Injectable()
@Update()
export class GreeterUpdate {
@Start()
async onStart(ctx: Context): Promise<void> {
await ctx.reply('Say hello to me');
}
@Hears(['hi', 'hello', 'hey', 'qq'])
async onGreetings(ctx: Context): Promise<void> {
const { first_name } = ctx.from;