aboutsummaryrefslogtreecommitdiffstats
path: root/bot/utils/helpers.py
diff options
context:
space:
mode:
authorGravatar Kronifer <[email protected]>2021-06-01 10:25:19 -0500
committerGravatar Kronifer <[email protected]>2021-06-01 10:25:19 -0500
commite9dd8d659daa066c624b9c455b474fe279282583 (patch)
treeb8cace4825a9956e5fdf71c7e5618ecee0d30020 /bot/utils/helpers.py
parentUpdate Pipfile (diff)
parentAdded "centisecond" in trivia_quiz.json (#751) (diff)
Merge branch 'main' of https://github.com/python-discord/sir-lancebot
Diffstat (limited to 'bot/utils/helpers.py')
-rw-r--r--bot/utils/helpers.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py
new file mode 100644
index 00000000..74c2ccd0
--- /dev/null
+++ b/bot/utils/helpers.py
@@ -0,0 +1,8 @@
+import re
+
+
+def suppress_links(message: str) -> str:
+ """Accepts a message that may contain links, suppresses them, and returns them."""
+ for link in set(re.findall(r"https?://[^\s]+", message, re.IGNORECASE)):
+ message = message.replace(link, f"<{link}>")
+ return message