From 84e192b0508bbff976d9c67d1a09eb3494e9629f Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Sun, 9 Aug 2020 23:03:01 -0400 Subject: [PATCH] Use more carefully crafted hooks --- youmubot-osu/src/discord/hook.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youmubot-osu/src/discord/hook.rs b/youmubot-osu/src/discord/hook.rs index 4469593..3c99f0e 100644 --- a/youmubot-osu/src/discord/hook.rs +++ b/youmubot-osu/src/discord/hook.rs @@ -20,13 +20,13 @@ use super::embeds::{beatmap_embed, beatmapset_embed}; lazy_static! { static ref OLD_LINK_REGEX: Regex = Regex::new( - r"https?://osu\.ppy\.sh/(?Ps|b)/(?P\d+)(?:[\&\?]m=(?P\d))?(?:\+(?P[A-Z]+))?" + r"(?:https?://)?osu\.ppy\.sh/(?Ps|b)/(?P\d+)(?:[\&\?]m=(?P\d))?(?:\+(?P[A-Z]+))?" ).unwrap(); static ref NEW_LINK_REGEX: Regex = Regex::new( - r"https?://osu\.ppy\.sh/beatmapsets/(?P\d+)/?(?:\#(?Posu|taiko|fruits|mania)(?:/(?P\d+)|/?))?(?:\+(?P[A-Z]+))?" + r"(?:https?://)?osu\.ppy\.sh/beatmapsets/(?P\d+)/?(?:\#(?Posu|taiko|fruits|mania)(?:/(?P\d+)|/?))?(?:\+(?P[A-Z]+))?" ).unwrap(); static ref SHORT_LINK_REGEX: Regex = Regex::new( - r"/b/(?P\d+)(?:/(?Posu|taiko|fruits|mania))?(?:\+(?P[A-Z]+))?" + r"(?:^|\s)/b/(?P\d+)(?:/(?Posu|taiko|fruits|mania))?(?:\+(?P[A-Z]+))?" ).unwrap(); }