In the BOT when we send a DM with an Image we are triyng the bet the base64 image to post in a image repository.
I came across this message:
StatusMessage:“Authorization Required”
This the code at the webhook:
requestencodingnull.get(url, function (error2, response2, bodyimage) {
if (error2) {
console.log(error2);
callback(error2);
} else {
//console.log(result3)
var buff = new Buffer(bodyimage).toString(‘base64’)
var data = “data:image/png;base64,” + buff
var matches2 = data.match(/^data:([A-Za-z-+/]+);base64,(.+)$/);
var type2 = matches2[1];
var buffer2 = new Buffer(matches2[2], ‘base64’);