Move postman and web inside src
This commit is contained in:
1 parent
075fde71df
commit
4a80d42f86
152 files changed
+833
-779
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use std::collections::HashSet;
|
||||
|
||||
use chrono::{Duration, NaiveDateTime, Utc};
|
||||
use chrono::{DateTime, NaiveDateTime, TimeDelta, Utc};
|
||||
use chrono_tz::Tz;
|
||||
use poise::serenity_prelude::{
|
||||
model::id::{ChannelId, GuildId, UserId},
|
||||
@@ -73,7 +73,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() - TimeDelta::try_minutes(1).unwrap()).naive_local() {
|
||||
Err(ReminderError::PastTime)
|
||||
} else {
|
||||
sqlx::query!(
|
||||
@@ -165,7 +165,7 @@ impl<'a> MultiReminderBuilder<'a> {
|
||||
}
|
||||
|
||||
pub fn time<T: Into<i64>>(mut self, time: T) -> Self {
|
||||
if let Some(utc_time) = NaiveDateTime::from_timestamp_opt(time.into(), 0) {
|
||||
if let Some(utc_time) = DateTime::from_timestamp(time.into(), 0).map(|d| d.naive_utc()) {
|
||||
self.utc_time = utc_time;
|
||||
}
|
||||
|
||||
@@ -173,7 +173,8 @@ impl<'a> MultiReminderBuilder<'a> {
|
||||
}
|
||||
|
||||
pub fn expires<T: Into<i64>>(mut self, time: Option<T>) -> Self {
|
||||
self.expires = time.map(|t| NaiveDateTime::from_timestamp_opt(t.into(), 0)).flatten();
|
||||
self.expires =
|
||||
time.map(|t| DateTime::from_timestamp(t.into(), 0)).flatten().map(|d| d.naive_utc());
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user