fix(katana): detect 4 cards dropping

I forgor
This commit is contained in:
tretrauit 2024-01-08 19:42:32 +07:00
parent 0f9331ba60
commit 56e51c8d2f
2 changed files with 11 additions and 15 deletions

View File

@ -257,14 +257,12 @@ pub async fn analyze_card_libtesseract(card: image::DynamicImage, count: u32) ->
Some(c) => { Some(c) => {
card = c; card = c;
} }
None => { None => match db::query_card_regex(&card.name, &card.series).await {
match db::query_card_regex(&card.name, &card.series).await {
Some(c) => { Some(c) => {
card = c; card = c;
} }
None => {} None => {}
} },
}
} }
card card
} }
@ -323,14 +321,12 @@ pub async fn analyze_card_subprocess(card: image::DynamicImage, count: u32) -> C
Some(c) => { Some(c) => {
card = c; card = c;
} }
None => { None => match db::query_card_regex(&card.name, &card.series).await {
match db::query_card_regex(&card.name, &card.series).await {
Some(c) => { Some(c) => {
card = c; card = c;
} }
None => {} None => {}
} },
}
} }
card card
} }

View File

@ -123,7 +123,7 @@ async fn parse_katana_event(ctx: &Context, event: MessageUpdateEvent) -> Result<
} }
async fn parse_katana(ctx: &Context, msg: &Message) -> Result<(), String> { async fn parse_katana(ctx: &Context, msg: &Message) -> Result<(), String> {
if msg.content.contains("is dropping 3 cards!") if (msg.content.contains("is dropping") && msg.content.contains("cards!"))
|| msg || msg
.content .content
.contains("I'm dropping 3 cards since this server is currently active!") .contains("I'm dropping 3 cards since this server is currently active!")