mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
Provide a way to give pagination functions a total page count
This commit is contained in:
parent
0b111d5b26
commit
64ff4b3ed8
7 changed files with 102 additions and 55 deletions
|
@ -65,8 +65,8 @@ async fn message_command(
|
|||
return Ok(());
|
||||
}
|
||||
let images = std::sync::Arc::new(images);
|
||||
paginate_reply_fn(
|
||||
move |page, ctx, msg: &mut Message| {
|
||||
paginate_reply(
|
||||
paginate_from_fn(|page, ctx, msg: &mut Message| {
|
||||
let images = images.clone();
|
||||
Box::pin(async move {
|
||||
let page = page as usize;
|
||||
|
@ -87,7 +87,8 @@ async fn message_command(
|
|||
.map_err(|e| e.into())
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
.with_page_count(images.len()),
|
||||
ctx,
|
||||
msg,
|
||||
std::time::Duration::from_secs(120),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue