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

@ -114,6 +114,7 @@ pub async fn choose(ctx: &Context, m: &Message, mut args: Args) -> CommandResult
.push(". Congrats! 🎉 🎊 🥳")
.build(),
)
.reference_message(m)
})
.await?;

View file

@ -33,7 +33,7 @@ async fn list(ctx: &Context, m: &Message, _: Args) -> CommandResult {
const ROLES_PER_PAGE: usize = 8;
let pages = (roles.len() + ROLES_PER_PAGE - 1) / ROLES_PER_PAGE;
paginate_fn(
paginate_reply_fn(
|page, ctx, msg| {
let roles = roles.clone();
Box::pin(async move {
@ -99,7 +99,7 @@ async fn list(ctx: &Context, m: &Message, _: Args) -> CommandResult {
})
},
ctx,
m.channel_id,
m,
std::time::Duration::from_secs(60 * 10),
)
.await?;

View file

@ -64,7 +64,7 @@ async fn message_command(
return Ok(());
}
let images = std::sync::Arc::new(images);
paginate_fn(
paginate_reply_fn(
move |page, ctx, msg: &mut Message| {
let images = images.clone();
Box::pin(async move {
@ -87,7 +87,7 @@ async fn message_command(
})
},
ctx,
msg.channel_id,
msg,
std::time::Duration::from_secs(120),
)
.await?;