Skip to content

Instantly share code, notes, and snippets.

@spddl
Created January 28, 2017 15:41
Show Gist options
  • Save spddl/b5c038df77d47a694098395c2441401e to your computer and use it in GitHub Desktop.
Save spddl/b5c038df77d47a694098395c2441401e to your computer and use it in GitHub Desktop.
const hangoutsBot = require("hangouts-bot");
let hangout=new hangoutsBot( config.hangout_user , config.hangout_pw );
hangout.on('online', function() {
c.Hangoutlog('online')
Event.emit('online','hangout');
});
hangout.on('error', function(e) {
c.warn('err: '+e);
Event.emit('error',e);
});
hangout.on('message', function(from, msg) {
let temp = config.hangout_kontakt(from)
c.Hangoutlog(temp.name + " >> " + msg);
Event.emit('message', 'hangout', {'from': from, 'name': temp.name, 'device': temp.device, 'message': msg});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment