From f507f8f4e8b77086865fb9e0a7480e7cde4cff1f Mon Sep 17 00:00:00 2001 From: git-bruh Date: Sat, 14 Nov 2020 21:04:30 +0530 Subject: [PATCH] Highlight message AFTER getting attachment --- main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 529af37..1914610 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,8 @@ -import logging -import json -import os -import nio import discord +import json +import logging +import nio +import os def config_gen(config_file): @@ -225,10 +225,11 @@ async def message_callback(room, event): # Get attachments try: + attachment = event.url.split("/")[-1] + # Highlight attachment name message = f"`{message}`" - attachment = event.url.split("/")[-1] message += f"\n{url}/{homeserver}/{attachment}" except AttributeError: pass