depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

.on fired twice #67

Open zigmund opened 8 years ago

zigmund commented 8 years ago

Hi there,

I started bot from example:

var Bot = require('node-telegram-bot');

var bot = new Bot({
  token: 'bla bla token'
})
.on('message', function (message) {
  console.log(message);
})
.start();

Every time I send msg to bot I got .on fired twice;

{ message_id: 12,
  from: 
   { id: 000,
     first_name: 'first',
     last_name: 'last',
     username: 'usr' },
  chat: 
   { id: 135648167,
     first_name: 'first',
     last_name: 'last',
     username: 'usr',
     type: 'private' },
  date: 1453575130,
  text: 'test' }
{ message_id: 12,
  from: 
   { id: 135648167,
     first_name: 'first',
     last_name: 'last',
     username: 'usr' },
  chat: 
   { id: 135648167,
     first_name: 'first',
     last_name: 'last',
     username: 'usr',
     type: 'private' },
  date: 1453575130,
  text: 'test' }
longstone commented 8 years ago

Does this problem still exist? do you might have a demo repo?