My code is the following, its purpose is nothing but sending an image together with a text "hi", but unfortunately doesn't work:
#!/usr/bin/node
var Client = require('hangupsjs');
var Q = require('q');
var path=require('path');
var fp=path.resolve(process.argv[2])
console.log(fp)
// callback to get promise for creds using stdin. this in turn
// means the user must fire up their browser and get the
// requested token.
var creds = function() {
return {
auth: Client.authStdin
};
};
var client = new Client();
// set more verbose logging
client.loglevel('info');
// receive chat message events
client.on('chat_message', function(ev) {
return console.log(ev);
});
// connect and post a message.
// the id is a conversation id.
client.connect(creds).then(function() {
client.uploadimage(fp, null, 30000).then(
function(image_id){
console.log("image_id: "+image_id);
client.createconversation([109444762308105529580]).then(function(conversation_obj){
console.log("conversation_id: "+JSON.stringify(conversation_obj, null, 4));
client.sendchatmessage(conversation_obj.conversation.id.id,
[[0, 'hi']],image_id).then(function(res){JSON.stringify(res, null, 4)},function(res){JSON.stringify(res, null, 4)},function(res){JSON.stringify(res, null, 4)}).done();
}
)
}
);
}).done();
Image is uploaded, its ID is printed, but conversation with the person isn't created. I don't know why.
Are they the Google+ IDs?
My code is the following, its purpose is nothing but sending an image together with a text "hi", but unfortunately doesn't work:
Image is uploaded, its ID is printed, but conversation with the person isn't created. I don't know why.