Fix soundboards
This commit is contained in:
parent
365d1df4ce
commit
52327b3695
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1924,7 +1924,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "soundfx-rs"
|
||||
version = "1.5.3"
|
||||
version = "1.5.4"
|
||||
dependencies = [
|
||||
"dashmap",
|
||||
"env_logger",
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "soundfx-rs"
|
||||
version = "1.5.3"
|
||||
version = "1.5.4"
|
||||
authors = ["jellywx <judesouthworth@pm.me>"]
|
||||
edition = "2018"
|
||||
|
||||
|
@ -197,8 +197,7 @@ impl SoundPager {
|
||||
let user_id = interaction.user.id;
|
||||
let guild_id = interaction.guild_id.unwrap();
|
||||
|
||||
match serde_json::from_str::<Self>(&interaction.data.custom_id) {
|
||||
Ok(pager) => {
|
||||
let pager = serde_json::from_str::<Self>(&interaction.data.custom_id)?;
|
||||
let sounds = pager.get_page(data, user_id, guild_id).await?;
|
||||
let count = match pager.context {
|
||||
ListContext::User => data.count_user_sounds(user_id).await?,
|
||||
@ -211,9 +210,7 @@ impl SoundPager {
|
||||
.interaction_response_data(|d| {
|
||||
d.ephemeral(true)
|
||||
.add_embed(pager.embed(&sounds, count))
|
||||
.components(|c| {
|
||||
c.add_action_row(pager.create_action_row(count / 25))
|
||||
})
|
||||
.components(|c| c.add_action_row(pager.create_action_row(count / 25)))
|
||||
})
|
||||
})
|
||||
.await?;
|
||||
@ -221,10 +218,6 @@ impl SoundPager {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Err(_) => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
async fn reply(&self, ctx: Context<'_>) -> Result<(), Error> {
|
||||
let sounds = self
|
||||
.get_page(ctx.data(), ctx.author().id, ctx.guild_id().unwrap())
|
||||
|
Loading…
Reference in New Issue
Block a user