Closed mcgrailm closed 12 years ago
this is where it is breaking for me
Bot.prototype._send = function (rq, callback) { rq.msgid = this._msgId; rq.clientid = this.clientId; rq.userid = rq.userid || this.userId; rq.userauth = this.auth;
var msg = JSON.stringify(rq);
if (this.debug) { if (this.stdout == 'stderr') { console.error('< ' + msg); } else { console.log('< ' + msg); } }
this.ws.send('~m~'+msg.length+'~m~'+msg); this._cmds.push([this._msgId, rq, callback]); this._msgId++; }
in bot.js
May I ask you to show your code ? Or add me on gtalk ! ( alain.gilbert.15 [at] gmail.com )
Apparently an error in the bot code...
thanks for your help
I'm having this exact error as well. I suspect I might be approaching subclassing the bot incorrectly. Any advice on what I'm doing wrong is welcome!
Hey, You have to wait until the bot is really into the room. In your code, that mean:
myBot.on('roomChanged', function() {
myBot.greet();
});
NodeJs is asynchrone. The socket wasn't ready.
shame
I should've looked up from the keyboard and realized this. Too busy second guessing my approach to subclassing.
Thanks for the swift response!
downloaded new code for tt fix thats going to happen and when I ran my bot script it faild with this
node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Cannot call method 'send' of undefined at [object Object]._send (exmaple.com/uberbot/bot/node_modules/ttapi/bot.js:299:12) at [object Object].bootUser (exmaple.com/uberbot/bot/node_modules/ttapi/bot.js:468:9) at [object Object].startAPI (exmaple.com/uberbot/bot/node_modules/uberbot/uberbot.js:941:14) at Object. (exmaple.com/uberbot/bot/marvin-mixxx.js:220:6)
at Module._compile (module.js:407:26)
at Object..js (module.js:413:10)
at Module.load (module.js:339:31)
at Function._load (module.js:298:12)
at Array. (module.js:426:10)
at EventEmitter._tickCallback (node.js:126:26)