From 7e6d6bd846d6c7c477dbfed51925ab2e4ae17f3d Mon Sep 17 00:00:00 2001 From: manetta Date: Fri, 18 Feb 2022 15:07:26 +0100 Subject: [PATCH] editing the delete reply message, to display the url of the media file --- LogBot/logbot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index 51f4a07..b214e7f 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -233,7 +233,10 @@ class Logbot(Bot): self.log.info( f"To be deleted: { self.db[message.room]['messages'][key] }" ) - reply = f"This message is deleted: { self.db[message.room]['messages'][key] }" + if 'media' in self.db[message.room]['messages'][key]: + reply = f"This message is deleted: { self.db[message.room]['messages'][key]['media']['url'] }" + else: + reply = f"This message is deleted: { self.db[message.room]['messages'][key]['post'] }" del self.db[message.room]["messages"][key] else: reply = "This message is already gone!"