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 )); }