Fix osu commands with replies

This commit is contained in:
Natsu Kagami 2023-02-17 14:02:42 +01:00
parent 556ada2b9d
commit 59551f1f6a
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51

View file

@ -400,7 +400,7 @@ pub(crate) async fn load_beatmap(
if let Some(replied) = &msg.referenced_message { if let Some(replied) = &msg.referenced_message {
// Try to look for a mention of the replied message. // Try to look for a mention of the replied message.
let beatmap_id = SHORT_LINK_REGEX.captures(&replied.content).or_else(|| { let beatmap_id = SHORT_LINK_REGEX.captures(&replied.content).or_else(|| {
msg.embeds.iter().find_map(|e| { replied.embeds.iter().find_map(|e| {
e.description e.description
.as_ref() .as_ref()
.and_then(|v| SHORT_LINK_REGEX.captures(&v)) .and_then(|v| SHORT_LINK_REGEX.captures(&v))
@ -446,6 +446,7 @@ pub(crate) async fn load_beatmap(
} }
#[command] #[command]
#[aliases("map")]
#[description = "Show information from the last queried beatmap."] #[description = "Show information from the last queried beatmap."]
#[usage = "[--set/-s/--beatmapset] / [mods = no mod]"] #[usage = "[--set/-s/--beatmapset] / [mods = no mod]"]
#[delimiters(" ")] #[delimiters(" ")]