mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-19 16:58:55 +00:00
osu: Try to find the right score when announcing
This commit is contained in:
parent
aa90422c99
commit
dc44a0b4b3
1 changed files with 4 additions and 1 deletions
|
@ -252,7 +252,10 @@ impl<'a> CollectedScore<'a> {
|
||||||
f.user(UserID::ID(user.id)).mode(event.mode)
|
f.user(UserID::ID(user.id)).mode(event.mode)
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
let score = match scores.into_iter().next() {
|
let score = match scores
|
||||||
|
.into_iter()
|
||||||
|
.find(|s| (s.date - event.date).abs() < chrono::TimeDelta::seconds(5))
|
||||||
|
{
|
||||||
Some(v) => v,
|
Some(v) => v,
|
||||||
None => return Err(Error::msg("cannot get score for map...")),
|
None => return Err(Error::msg("cannot get score for map...")),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue