diff --git a/src/discord_irc.rs b/src/discord_irc.rs index b2bbab2..7557135 100644 --- a/src/discord_irc.rs +++ b/src/discord_irc.rs @@ -272,6 +272,7 @@ async fn discord_to_irc_processing( regex! { static PING_RE_1 = r"<@([0-9]+)>"; static PING_RE_2 = r"<@!([0-9]+)>"; + static PING_RE_3 = r"\{@([0-9]+)\}"; static EMOJI_RE = r"<:(\w+):[0-9]+>"; static CHANNEL_RE = r"<#([0-9]+)>"; static ROLE_RE = r"<@&([0-9]+)>"; @@ -317,6 +318,9 @@ async fn discord_to_irc_processing( ) .into_owned(); + // switch brackets of unknown pings + computed = PING_RE_1.replace_all(&computed, "{@$1}").into_owned(); + computed = { #[allow(clippy::enum_glob_use)] use pulldown_cmark::{Event::*, Tag::*}; @@ -380,5 +384,8 @@ async fn discord_to_irc_processing( new }; + // switch them back + computed = PING_RE_3.replace_all(&computed, "<@$1>").into_owned(); + computed }