Strip away discord's "link embed escape" syntax

This commit is contained in:
Yash Karandikar 2022-07-25 19:05:03 -05:00
parent 245cb167bb
commit 5fb4e69b6d

View file

@ -255,10 +255,13 @@ async fn discord_to_irc_processing(
static EMOJI_RE = r"<:(\w+):[0-9]+>";
static CHANNEL_RE = r"<#([0-9]+)>";
static ROLE_RE = r"<@&([0-9]+)>";
static URL_ESCAPE_RE = r"<(https?://[^\s/$.?#].\S*)>";
}
let mut computed = message.to_owned();
computed = URL_ESCAPE_RE.replace_all(&computed, "$1").into_owned();
computed = PING_RE_1
.replace_all(&computed, MemberReplacer { members })
.into_owned();