From d8f42c1b25f640c47397a1de841bdc5af04e2962 Mon Sep 17 00:00:00 2001 From: jellywx Date: Sun, 7 Nov 2021 13:23:41 +0000 Subject: [PATCH] fixed an issue with utc time. removed intents --- src/main.rs | 8 +------- src/models/reminder/builder.rs | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9ff66d1..57329e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -235,13 +235,7 @@ async fn main() -> Result<(), Box> { let framework_arc = Arc::new(framework); let mut client = Client::builder(&token) - .intents(if dm_enabled { - GatewayIntents::GUILD_MESSAGES - | GatewayIntents::GUILDS - | GatewayIntents::DIRECT_MESSAGES - } else { - GatewayIntents::GUILD_MESSAGES | GatewayIntents::GUILDS - }) + .intents(GatewayIntents::GUILDS) .application_id(application_id.0) .event_handler(Handler) .await diff --git a/src/models/reminder/builder.rs b/src/models/reminder/builder.rs index f6e5f74..f258f37 100644 --- a/src/models/reminder/builder.rs +++ b/src/models/reminder/builder.rs @@ -76,7 +76,7 @@ impl ReminderBuilder { match queried_time.utc_time { Some(utc_time) => { - if utc_time < (Utc::now() + Duration::seconds(60)).naive_local() { + if utc_time < (Utc::now() - Duration::seconds(60)).naive_local() { Err(ReminderError::PastTime) } else { sqlx::query!(