OS
Size: a a a
OS
Б
ym
ym
OS
JD
JD
JD
const TelegrafI18n = require('telegraf-i18n')
const { greet } = require('./handlers')
...
const i18n = new TelegrafI18n({
defaultLanguage: 'ru',
directory: path.resolve(__dirname, 'locales')
})
...
bot.use(i18n)
bot.hears(['hi', TelegrafI18n.match('btn.hi')], greet)
bot.on('other_shit', greet)
handlers/greet.jsmodule.exports = ctx => ctx.reply(ctx.i18n.t(greet))locales/ru.yml
btn:
hi: привет
greet: йоу
i
JD
i
JD
i
JD
i
SB
SB
JD
ym