This commit is contained in:
2023-06-07 18:28:05 +02:00
parent 32077a02bb
commit 3533fb9db5

View File

@@ -119,7 +119,10 @@ impl CommandParse<Self> for DownloadArchiveCommand {
fn parse(s: &str, bot_name: &str) -> Result<Self, strum::ParseError> {
let re = Regex::new(r"^/da_(?P<type>[s|a|t])_(?P<id>\d+)$").unwrap();
let caps = re.captures(s);
let full_bot_name = format!("@{bot_name}");
let after_replace = s.replace(&full_bot_name, "");
let caps = re.captures(&after_replace);
let caps = match caps {
Some(v) => v,
None => return Err(strum::ParseError::VariantNotFound),