mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
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:
parent
61a71b819c
commit
bd845d9662
13 changed files with 450 additions and 156 deletions
|
@ -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?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue