mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 09:10:49 +00:00
pagination: Directly pass list of interactions to render
This commit is contained in:
parent
8c5135bfc9
commit
5fde2f343a
7 changed files with 59 additions and 47 deletions
|
@ -77,9 +77,7 @@ async fn list(ctx: &Context, m: &Message, _: Args) -> CommandResult {
|
|||
.push_line(format!("Page **{}/{}**", page + 1, pages))
|
||||
.build();
|
||||
|
||||
Ok(Some(
|
||||
EditMessage::new().content(content).components(vec![btns]),
|
||||
))
|
||||
Ok(Some(EditMessage::new().content(content).components(btns)))
|
||||
})
|
||||
})
|
||||
.with_page_count(pages),
|
||||
|
|
|
@ -81,7 +81,7 @@ async fn message_command(
|
|||
images.len(),
|
||||
images[page]
|
||||
))
|
||||
.components(vec![btns]),
|
||||
.components(btns),
|
||||
))
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue