Closed ghost closed 11 years ago
ok... what is your code... ? Do you get any error ?
no, he just won't respond.
var Bot = require('ttapi');
var AUTH = 'xxx';
var USERID = 'xxx';
var ROOMID = 'xxx';
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+'?');
}
});
You can see him in the room ? Have you installed "ttapi" with npm ?
i can see him in the room and i installed ttapi with npm.
If you do :
bot.on('speak', function (data) {
console.log("--- TEST ---");
console.log(data, data.text == '/hello');
});
Can you see the --- TEST ---
in the terminal ?
If yes, what's the complete output ?
no
I mean, you have to write something in the chat... then it should appear in the terminal.
ok
it started working again after I refreshed the bot
My bot is not saying Hey, How are you when you do the hello command.