From 64e7eb4a53467a5587b32bec94714ef2d0461120 Mon Sep 17 00:00:00 2001 From: jude Date: Thu, 15 Sep 2022 13:16:05 +0100 Subject: [PATCH] order by ID descending --- src/main.rs | 10 +++------- src/models/sound.rs | 8 ++++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index ba05610..cb72425 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,13 +132,9 @@ async fn main() -> Result<(), Box> { .token(discord_token) .user_data_setup(move |ctx, _bot, framework| { Box::pin(async move { - register_application_commands( - ctx, - framework, - None, - ) - .await - .unwrap(); + register_application_commands(ctx, framework, None) + .await + .unwrap(); Ok(Data { http: reqwest::Client::new(), diff --git a/src/models/sound.rs b/src/models/sound.rs index 752d52f..f65c3f5 100644 --- a/src/models/sound.rs +++ b/src/models/sound.rs @@ -190,7 +190,7 @@ LIMIT 25 SELECT name, id, public, server_id, uploader_id FROM sounds WHERE uploader_id = ? - ORDER BY name + ORDER BY id DESC LIMIT ?, ? ", user_id.into(), @@ -207,7 +207,7 @@ SELECT name, id, public, server_id, uploader_id SELECT name, id, public, server_id, uploader_id FROM sounds WHERE uploader_id = ? - ORDER BY name + ORDER BY id DESC ", user_id.into() ) @@ -232,7 +232,7 @@ SELECT name, id, public, server_id, uploader_id SELECT name, id, public, server_id, uploader_id FROM sounds WHERE server_id = ? - ORDER BY name + ORDER BY id DESC LIMIT ?, ? ", guild_id.into(), @@ -250,7 +250,7 @@ SELECT name, id, public, server_id, uploader_id SELECT name, id, public, server_id, uploader_id FROM sounds WHERE server_id = ? - ORDER BY name + ORDER BY id DESC ", guild_id.into() )