From 6cddc95e8dc863c2e40e92372c267305ee80c4be Mon Sep 17 00:00:00 2001
From: derouet2018 <tristan.derouet@gmail.com>
Date: Wed, 23 Aug 2023 14:52:53 +0200
Subject: [PATCH] Send message with link to image to matrix when editing
 message with image and no text in discord

---
 src/bot.ts | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bot.ts b/src/bot.ts
index c2f69a6..00e00dd 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -1200,6 +1200,9 @@ export class DiscordBot {
         if (storeEvent && storeEvent.Result) {
             while (storeEvent.Next()) {
                 const matrixIds = storeEvent.MatrixId.split(";");
+                if(!oldMsg.content && oldMsg.attachments.array().length>0){
+                    newMsg.content = newMsg.content + " " + oldMsg.attachments.array()[0].url;
+                }
                 await this.OnMessage(newMsg, matrixIds[0]);
                 return;
             }
-- 
GitLab