Releases: EdJoPaTo/grammy-inline-menu
v9.2.0
v9.1.0
v9.0.2
v9.0.1
v9.0.0
The main change of this release is the move of longer MenuTemplate
arguments into the options object.
This results in shorter lines and easier code readability.
It also allows to inline methods easier.
-menuTemplate.interact((ctx) => ctx.i18n.t('button'), 'unique', {
+menuTemplate.interact('unique', {
+ text: (ctx) => ctx.i18n.t('button'),
do: async (ctx) => {
…
}
}
-menuTemplate.url('Text', 'https://edjopato.de', { joinLastRow: true });
+menuTemplate.url({ text: 'Text', url: 'https://edjopato.de', joinLastRow: true });
-menuTemplate.choose('unique', ['walk', 'swim'], {
+menuTemplate.choose('unique', {
+ choices: ['walk', 'swim'],
do: async (ctx, key) => {
…
}
}
Also Node.js 18 and ES modules are now required when using this library.
v8.0.1
v8.0.0
v7.0.2
v7.0.1
v7.0.0
Migration from Telegraf to grammY
This version switches from Telegraf to grammY as a Telegram Bot framework. grammY has various benefits over Telegraf as Telegraf is quite old and grammY learned a lot from its mistakes and shortcomings.
Supporting both Telegraf and grammY would have increased the complexity a lot. Seeing grammY as the way to go and the library of choice for my bots it was the best way to move forward in my opinion.
If you are still using Telegraf you can continue to use v6 but you should consider migrating to grammY.
-import {Telegraf} from 'telegraf'
-import {MenuTemplate, MenuMiddleware} from 'telegraf-inline-menu'
+import {Bot} from 'grammy'
+import {MenuTemplate, MenuMiddleware} from 'grammy-inline-menu'