From 8ad706e1eefb3e88e797101e349ad372920f345e Mon Sep 17 00:00:00 2001 From: sticks Date: Mon, 25 Nov 2024 19:49:19 -0600 Subject: [PATCH] questioning sanity --- src/commands/quote.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/commands/quote.rs b/src/commands/quote.rs index 145de80..8a92eab 100644 --- a/src/commands/quote.rs +++ b/src/commands/quote.rs @@ -14,7 +14,7 @@ pub async fn quote_action( username: message.author.name.clone(), quote: message.content.clone(), added_by: ctx.author().id.into(), - added_at: Some(OffsetDateTime::now_utc()), + added_at: OffsetDateTime::now_utc(), }; if quote.user_id == quote.added_by { @@ -40,12 +40,7 @@ pub async fn random_quote(ctx: Context<'_>) -> Result<(), Error> { "{}: {}\nQuoted at: by <@{}>", quote.username, quote.quote, - if let Some(added_at) = quote.added_at { - added_at.unix_timestamp() - } else { - // Use now if added_at is None - OffsetDateTime::now_utc().unix_timestamp() - }, + quote.added_at.unix_timestamp(), quote.added_by )) .allowed_mentions(CreateAllowedMentions::new().empty_users()), @@ -81,12 +76,7 @@ pub async fn user_quotes( "{}: {}\nQuoted at: by <@{}>\n", quote.username, quote.quote, - if let Some(added_at) = quote.added_at { - added_at.unix_timestamp() - } else { - // Use now if added_at is None - OffsetDateTime::now_utc().unix_timestamp() - }, + quote.added_at.unix_timestamp(), quote.added_by )); }