Convert array buffer to regular buffers through processes

This commit is contained in:
nolan 2020-07-24 12:34:46 -07:00
parent da61ec0712
commit 6ddc625459
2 changed files with 4 additions and 0 deletions

View File

@ -172,6 +172,8 @@ class MongoDBProvider extends Provider {
return new Promise((resolve, reject) => {
if(data.buffer) data.buffer = Buffer.from(data.buffer);
this.db.collection(collection).insertOne(data, (err, result) => {
if(err) reject(err);

View File

@ -132,6 +132,8 @@ class MessageCache extends Observer {
this.client.logger.error(`Failed to save buffer with image data: ${data}\n${err.stack || err}`);
return null;
});
console.log(buffer);
if(buffer) {
try {