问题描述:

 gSearch: function(message){

googleSearch.build({

q: message

},

function(error, response)

{

console.log(response);

chain.send('/me ' + response);

});

},

Returns [ Object object ] as the result

This is not for HTML, its a bot meant for an IRC type chat. You send a request like !g "search term" then it is supposed to send back the search result to the chat. Made with node.js

网友答案:

you can make something like that:

gSearch: function(message){ googleSearch.build({ q: message
}, function(error, response) {
console.log(response); chain.send('/me', JSON.stringify(response)); }); },

网友答案:

[Object object] is the serialization of a javascript object.

You may want to stringify it:

console.log(JSON.stringify(response))
相关阅读:
Top