More osu improvements (#11)

* Don't show DT when NC is on

* Allow leading + in mods parsing

* Extend Pagination

* Implement beatmapset display

* Move OkPrint to prelude

* Beatmapset display seems to work

* Put reaction handler into static

* Make clippy happy

* Add beatmapset caching and last --set

* Delay loading of beatmap info

* Simplify hook link handling

* Replies everywhere!

* Replies everywhereee!
This commit is contained in:
Natsu Kagami 2021-02-02 02:13:40 +09:00 committed by GitHub
parent 61a71b819c
commit bd845d9662
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 450 additions and 156 deletions

View file

@ -171,7 +171,7 @@ pub async fn ranks(ctx: &Context, m: &Message) -> CommandResult {
let total_pages = (ranks.len() + ITEMS_PER_PAGE - 1) / ITEMS_PER_PAGE;
let last_updated = ranks.iter().map(|(_, cfu)| cfu.last_update).min().unwrap();
paginate_fn(
paginate_reply_fn(
move |page, ctx, msg| {
let ranks = ranks.clone();
Box::pin(async move {
@ -237,7 +237,7 @@ pub async fn ranks(ctx: &Context, m: &Message) -> CommandResult {
})
},
ctx,
m.channel_id,
m,
std::time::Duration::from_secs(60),
)
.await?;
@ -301,7 +301,7 @@ pub async fn contestranks(ctx: &Context, m: &Message, mut args: Args) -> Command
const ITEMS_PER_PAGE: usize = 10;
let total_pages = (ranks.len() + ITEMS_PER_PAGE - 1) / ITEMS_PER_PAGE;
paginate_fn(
paginate_reply_fn(
move |page, ctx, msg| {
let contest = contest.clone();
let problems = problems.clone();
@ -391,7 +391,7 @@ pub async fn contestranks(ctx: &Context, m: &Message, mut args: Args) -> Command
})
},
ctx,
m.channel_id,
m,
Duration::from_secs(60),
)
.await?;