. and / as cmd

This commit is contained in:
Flummi 2017-11-10 10:21:32 +01:00
parent 42e04f58b7
commit 8a4da4b78d

View File

@ -10,7 +10,7 @@ class tg {
this.options.polling = options.polling || true; this.options.polling = options.polling || true;
this.client = new tgapi(this.options.token, this.options); this.client = new tgapi(this.options.token, this.options);
this.client.onText(/.*/, msg => { this.client.on('message', msg => {
if (msg.date >= (~~(Date.now() / 1000) - 10)) { if (msg.date >= (~~(Date.now() / 1000) - 10)) {
msg.text = msg.text.replace(/^\//g, "\."); msg.text = msg.text.replace(/^\//g, "\.");
this.emit('data', ['message', this.reply(msg)]); this.emit('data', ['message', this.reply(msg)]);