From bc1a60205eef2e037716aad72026e1a4942489bf Mon Sep 17 00:00:00 2001 From: John Doe Date: Tue, 14 Feb 2023 20:34:12 +0000 Subject: [PATCH] Update matrix.js to remove error and fix spacing/tab inconsistencies --- libs/notifications/matrix.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/libs/notifications/matrix.js b/libs/notifications/matrix.js index 02be6574..b01a87e1 100644 --- a/libs/notifications/matrix.js +++ b/libs/notifications/matrix.js @@ -1,4 +1,3 @@ -cat Shinobi/libs/notifications/matrix.js const fs = require("fs") const fetch = require("node-fetch") module.exports = function(s,config,lang,getSnapshot){ @@ -16,17 +15,17 @@ module.exports = function(s,config,lang,getSnapshot){ buffer, name, type, - info, - opttype, + info, + opttype, } = file; client.uploadContent(buffer, { name: name, - type: opttype, + type: opttype, }).then(function(url) { const content = { msgtype: type || "m.file", body: name, - info: info, + info: info, url: url.content_uri }; client.sendMessage(roomId, content); @@ -97,10 +96,10 @@ module.exports = function(s,config,lang,getSnapshot){ buffer: d.screenshotBuffer, name: d.screenshotName+'.jpg', type: 'm.image', - opttype: 'image/jpeg', - info: { - mimetype: 'image/jpeg', - }, + opttype: 'image/jpeg', + info: { + mimetype: 'image/jpeg', + }, } ],d.ke) } @@ -125,7 +124,7 @@ module.exports = function(s,config,lang,getSnapshot){ buffer: await fs.promises.readFile(videoPath), name: videoName, type: 'm.video', - opttype: 'video/mp4', + opttype: 'video/mp4', info: { mimetype: 'video/mp4', }, @@ -384,4 +383,4 @@ module.exports = function(s,config,lang,getSnapshot){ console.log('Could not start Matrix bot, please run "npm install matrix-js-sdk" inside the Shinobi folder.') } } -} \ No newline at end of file +}