Skip to content

v9.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 12 Mar 19:24
· 20 commits to main since this release
21822a9

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.