mathew-kurian / FacebookMessengerBot.js

:mailbox: Simple, light-weight Facebook Messenger Bot API for Node with ES6 support (via. Promises)
https://developers.facebook.com/docs/messenger-platform
117 stars 24 forks source link

how do I run it? #2

Open HERRKIN opened 8 years ago

HERRKIN commented 8 years ago

I installed babel in node v6 (never tried it before) I typed babel app.js just copy paste and editing the tokens of your example. it throws this error.

SyntaxError: app.js: Unexpected token (5:24)
  3 | const bot = new Bot(mytoken, myvertoken);
  4 | 
> 5 | bot.on('message', async message => {
    |                         ^
  6 |     const {sender} = message;
  7 |     await sender.fetch('first_name');
  8 | 
gendra-mx commented 7 years ago

You need to include the babel dependencies in package.json and the .babelrc file into your project, that works for me! 😅