Closed edakhmetgareev closed 8 years ago
👍 confirm it, really annoying. Temp solution:
.when({ name: 'Search', test: m => m.text.match(/.+/) }, new SearchController(config));
I ran into this just now as well, there is a pretty quick fix, from line 321 in TelegramRouter
:
while (arg = command.exec(message.text)) {
query.push(arg[1] || arg[0])
if (command.lastIndex === 0)
break;
}
I might submit a PR tomorrow, too tired to think right now 😉
Fixed!
Hello,
I have catched a problem with regexp route setting. When I try to set something like this
tg.router.when([/\/top10/, /\/top3/], new TopController())
without /g key, then in TelegramRouter.js on line 231 this codewhile (arg = command.exec(message.text)) {
query.push(arg[1] || arg[0])
}
goes into an infinite loop.