mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
osu: add passes_only flag to recent command
This commit is contained in:
parent
068dd48550
commit
487f8647ba
2 changed files with 13 additions and 2 deletions
|
@ -248,6 +248,7 @@ pub mod builders {
|
|||
user: UserID,
|
||||
mode: Option<Mode>,
|
||||
limit: Option<u8>,
|
||||
include_fails: bool,
|
||||
}
|
||||
|
||||
impl UserScoreRequestBuilder {
|
||||
|
@ -257,6 +258,7 @@ pub mod builders {
|
|||
user,
|
||||
mode: None,
|
||||
limit: None,
|
||||
include_fails: true,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,11 +272,16 @@ pub mod builders {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn include_fails(&mut self, include_fails: bool) -> &mut Self {
|
||||
self.include_fails = include_fails;
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) async fn build(self, client: &OsuClient) -> Result<Vec<models::Score>> {
|
||||
let scores = handle_not_found({
|
||||
let mut r = client.rosu.user_scores(self.user);
|
||||
r = match self.score_type {
|
||||
UserScoreType::Recent => r.recent().include_fails(true),
|
||||
UserScoreType::Recent => r.recent().include_fails(self.include_fails),
|
||||
UserScoreType::Best => r.best(),
|
||||
UserScoreType::Pin => r.pinned(),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue