import { Command, Ctx, Hears, Start, Update, Sender } from 'nestjs-telegraf'; import { UpdateType as TelegrafUpdateType } from 'telegraf/typings/telegram-types'; import { Context } from '../interfaces/context.interface'; import { HELLO_SCENE_ID } from '../app.constants'; import { UpdateType } from '../common/decorators/update-type.decorator'; @Update() export class GreeterUpdate { @Start() onStart(): string { return 'Say hello to me'; } @Hears(['hi', 'hello', 'hey', 'qq']) onGreetings( @UpdateType() updateType: TelegrafUpdateType, @Sender('first_name') firstName: string, ): string { return `Hey ${firstName}`; } @Command('scene') async onSceneCommand(@Ctx() ctx: Context): Promise { await ctx.scene.enter(HELLO_SCENE_ID); } }