mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-03-15 22:43:45 +03:00
fix(sample): use update decorator for greeter
This commit is contained in:
parent
8fcec73afd
commit
4420e01d8a
@ -1,9 +1,13 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Hears, Start, Update } from '../../lib';
|
||||||
import { Hears } from '../../lib';
|
|
||||||
import { Context } from '../interfaces/context.interface';
|
import { Context } from '../interfaces/context.interface';
|
||||||
|
|
||||||
@Injectable()
|
@Update()
|
||||||
export class GreeterUpdate {
|
export class GreeterUpdate {
|
||||||
|
@Start()
|
||||||
|
async onStart(ctx: Context): Promise<void> {
|
||||||
|
await ctx.reply('Say hello to me');
|
||||||
|
}
|
||||||
|
|
||||||
@Hears(['hi', 'hello', 'hey', 'qq'])
|
@Hears(['hi', 'hello', 'hey', 'qq'])
|
||||||
async onGreetings(ctx: Context): Promise<void> {
|
async onGreetings(ctx: Context): Promise<void> {
|
||||||
const { first_name } = ctx.from;
|
const { first_name } = ctx.from;
|
||||||
|
Loading…
Reference in New Issue
Block a user