mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-27 00:08:09 +03:00
17 lines
427 B
TypeScript
17 lines
427 B
TypeScript
import { Hears, Start, Update } from '../../lib';
|
|
import { Context } from '../interfaces/context.interface';
|
|
|
|
@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;
|
|
await ctx.reply(`Hey ${first_name}`);
|
|
}
|
|
}
|