From 9d1d736ae5dc9e6266884c1cfe9c8982587041f7 Mon Sep 17 00:00:00 2001 From: Edgar To Date: Thu, 20 Sep 2018 21:55:00 +0200 Subject: [PATCH] fix(select): setFunc and hide key argument are now the last match group this requires you to get the rest of the options via the ctx.match but handles backwards compability. also its nice to have it for simpler menus --- inline-menu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inline-menu.js b/inline-menu.js index 85f60ed..a7a8193 100644 --- a/inline-menu.js +++ b/inline-menu.js @@ -277,7 +277,7 @@ class TelegrafInlineMenu { throw new Error('setFunc and submenu can not be set at the same time.') } - const keyFromCtx = ctx => ctx.match[1] + const keyFromCtx = ctx => ctx.match[ctx.match.length - 1] const hideSelectAction = hide && (ctx => hide(ctx, keyFromCtx(ctx))) const handler = {