nestjs-telegraf-i18n
Version:
I18n integration for NestJS Telegraf
15 lines (14 loc) • 587 B
text/typescript
import {Command, Ctx, Update} from 'nestjs-telegraf';
import {Scenes} from "telegraf";
import { TelegrafI18nContext } from '../src';
// import { TelegrafI18nContext } from 'nestjs-telegraf-i18n';
()
export class BotUpdate {
('hello')
async helloCommand(() ctx: Scenes.WizardContext & TelegrafI18nContext) {
// You have access to both the WizardContext and TelegrafI18nContext internals
const internationalized_message = ctx._i18n.t("i18n.menus.hello.message");
await ctx.reply(internationalized_message);
await ctx.scene.enter('some_scene');
}
}