Skip to content

Instantly share code, notes, and snippets.

@zubairov
Created November 23, 2016 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zubairov/7a1ecda4c2488a7dee074919578050b5 to your computer and use it in GitHub Desktop.
Save zubairov/7a1ecda4c2488a7dee074919578050b5 to your computer and use it in GitHub Desktop.
function* run() {
console.log('Incoming attachments=%j', Object.keys(msg.attachments || {}));
for(let name in msg.attachments) {
let attachment = msg.attachments[name];
console.log('Handling attachment with name=%s url=%s', name, attachment.url);
var result = yield request.get({uri : attachment.url});
console.log('Content of the attachment is %j', result.body);
};
return {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment