grammyjs / grammY

The Telegram Bot Framework.
https://grammy.dev
MIT License
2.24k stars 112 forks source link

menu plugin with multiple language translations error #592

Closed hisunny520 closed 2 months ago

hisunny520 commented 4 months ago

` const menu = new Menu('me')

menu .text(ctx => ${ctx.t('text')}, ctx => ctx.reply(You chose))

err: {
  "type": "TypeError",
  "message": "ctx.t is not a function",
  "stack":
      TypeError: ctx.t is not a function

`

KnorpelSenf commented 4 months ago

You have to register the i18n plugin before the menu if you want to use the i18n plugin inside the menu.

The order of your middleware matters regardless of which plugins you use. https://grammy.dev/guide/middleware

KnorpelSenf commented 2 months ago

Closing due to inactivity.