Size: a a a

2016 October 02

NA

Narek Abovyan in Dev Chat
there is no need for babel
источник

b

borik91 in Dev Chat
within the nodejs -v 6.7.0
источник

NA

Narek Abovyan in Dev Chat
try to run it directly, without babel
источник

b

borik91 in Dev Chat
yep, btw, maybe i use it not in right way...
источник

b

borik91 in Dev Chat
check this code
источник

b

borik91 in Dev Chat
new Telegram.Telegram(config.botToken, { workers: 1 })
.router
 .when('/start', new Help())
 .when(/\/e\s?(.*)/, new Epg())
 .when('/f', new Find())
 .when('/c', new Channels())
 .when('/l', new List())
 .when('/h', new Help())
 .when('/d :id', new Details())
 .when('/r :id', new Related())
 .when('/p', new Provider())
 .when(/\/w\s?(.*)/, new TimeTable())
 .otherwise(new WrongCommand());
источник

b

borik91 in Dev Chat
should first argument for 'when' be a TextCommand instance?
источник

b

borik91 in Dev Chat
or it could be simple String too?
источник

b

borik91 in Dev Chat
*like in previos versions of telegram-node-bot, i think
источник

NA

Narek Abovyan in Dev Chat
it must be instance of any class extended of BaseCommand
источник

b

borik91 in Dev Chat
I got it
источник

b

borik91 in Dev Chat
Maybe that's my mistake
источник

b

borik91 in Dev Chat
I'll check
источник

b

borik91 in Dev Chat
Thx mate
источник

NA

Narek Abovyan in Dev Chat
library provides three of them out of box: CustomFilterCommand, RegexpCommand, TextCommand
источник

NA

Narek Abovyan in Dev Chat
no problem 👌
источник
2016 October 03

NK

ID:283656506 in Dev Chat
Hi
источник

NK

ID:283656506 in Dev Chat
I have a question regarding commands: I'm uncertain how to add params to a command. I tried doing something similar to the example with extending scopes, but then the command would fail.
источник

NK

ID:283656506 in Dev Chat
I just went throught the last couple of questions here, and the syntax .when('/somecommand :param1 :param2', new SomeCommand()) is mentioned, is this how it works? I'm unable to find what I'm looking for in the Readme/API doc..
источник

NK

ID:283656506 in Dev Chat
Thanks in advance :)
источник