From 9be1a2563c4e415600647d683d9fc177ae3c5c0c Mon Sep 17 00:00:00 2001
From: salixor <salixor@pm.me>
Date: Thu, 9 Nov 2023 00:09:12 +0100
Subject: [PATCH] Don't push body to Discord for attachments

---
 src/matrixeventprocessor.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts
index 67638f0..0df7733 100644
--- a/src/matrixeventprocessor.ts
+++ b/src/matrixeventprocessor.ts
@@ -299,7 +299,7 @@ export class MatrixEventProcessor {
         }
 
         let body: string = "";
-        if (event.type !== "m.sticker") {
+        if (!this.HasAttachment(event)) { // ignore body when there's an attachment
             const content = event.content!["m.new_content"] ? event.content!["m.new_content"] : event.content;
             body = await this.matrixMsgProcessor.FormatMessage(content as IMatrixMessage, channel.guild, params);
         }
-- 
GitLab