alaingilbert/Turntable-API — Issue #33: Getting bot to enter room and do things... it's a mystery!
Author: VegaChastain
Created: 2012-03-06 04:28:30+00:00
State: open

We chatted earlier - I created a folder with a file, main.js:
var Bot = require('../index');
var AUTH = 'auth+live+...';
var USERID = '...';
var ROOMID = '...';

var bot = new Bot(AUTH, USERID, ROOMID);

bot.on('speak', function (data) {
// Get the data
var name = data.name;
var text = data.text;

// Respond to "/hello" command
if (text.match(/^\/hello$/)) {
bot.speak('Hey! How are you '+name+' ?');
}
});

Just trying to get the bot in the room. I created the file in text edit. The main.js file is in /bot folder, so I open mongoDB, connect to mongo shell, and in a seperate terminal window i cd to the bot folder and say $ node main.js
This is what happens.
$ node main.js

/bot/main.js:1
{\rtf1\ansi\ansi
^

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:429:25)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)

I hate that I don't know what all that means. I have node installed, node_modules is located in my root, and I have ttapi, mongoose, and mysql. MongoDB is running and I have the shell open. I don't know what is wrong. Anyone? Grrrr.
Thanks so much.
*Vega*