From 2dbbc87ded20d7aadce8baba3f3ed28f88d87374 Mon Sep 17 00:00:00 2001
From: salixor <salixor@pm.me>
Date: Wed, 25 Dec 2024 23:26:39 +0100
Subject: [PATCH] Is the fix this easy ?

---
 src/matrixeventprocessor.ts | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts
index d518826..cd994a4 100644
--- a/src/matrixeventprocessor.ts
+++ b/src/matrixeventprocessor.ts
@@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
 limitations under the License.
 */
 
+/* eslint max-classes-per-file: 0 */
+/* eslint max-lines: 0 */
 import * as Discord from "@mx-puppet/better-discord.js";
 import { DiscordBot } from "./bot";
 import { DiscordBridgeConfig } from "./config";
@@ -352,11 +354,11 @@ export class MatrixEventProcessor {
         const name = this.GetFilenameForMediaEvent(event.content);
         const url = this.bridge.botClient.mxcToHttp(event.content.url);
         if (size < MaxFileSize) {
-            const attachment = (await Util.DownloadFile(url)).buffer;
-            size = attachment.byteLength;
+            const attachment = await this.bridge.botClient.downloadContent(event.content.url);
+            size = attachment.data.byteLength;
             if (size < MaxFileSize) {
                 return {
-                    attachment,
+                    attachment: attachment.data,
                     name,
                 } as Discord.FileOptions;
             }
-- 
GitLab