From 163175748f9de19a195e201d0cc6be26cf1abe70 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Thu, 3 Jun 2021 16:22:38 +0200 Subject: [PATCH] Get some clickable links --- LogBot/logbot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index 98ec340..ea4b958 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -147,6 +147,9 @@ class Logbot(Bot): self.db[message.room]["messages"][new_key] = media_post else: post = message.content.replace("@add ", "") + for url in re.findall(r"http\S+", post): + url_with_href = f"{url}" + post.replace(url, url_with_href) self.db[message.room]["messages"][new_key] = post self.db._dumps()