Closed Yojj closed 7 years ago
Hi! I´m not sure if you already made it in the start of your file, but the RegexpCommand is a method inside the telegram-node-bot Class. Try calling it that way:
const Telegram = require('telegram-node-bot');
const RegexpCommand = Telegram.RegexpCommand;
.when(
new RegexpCommand(new RegExp(/test/, 'g'), 'testHandler'),
new TestController()
)
Hope it helps! ;)
Hello,
On the documentation this method is create and says that ...
tg.router
.when(
new RegexpCommand(/test/g, 'testHandler'),
new TestController()
)
but a loggout say "error Not implemented"
Regards
Hello, example for works
var reg =/ Hi | Hello | Hao | Vitayu |\b/i;
tg.router .when(new Telegram.RegexpCommand ( reg, 'pingCommand'), new HiController() )
использую из примера .when( new RegexpCommand(new RegExp(/test/, 'g'), 'testHandler'), new TestController() )
пишет RegexpCommand - is not installed
new RegexpCommand(new RegExp(/test/, 'g'), 'testHandler'), ^ ReferenceError: RegexpCommand is not defined
подскажите, пожалуйста, как решить? Спасибо!