···187187 ctx: Context<'_>,
188188 #[description = "Member to search for. This must be a user ID."] user_id: String,
189189) -> Result<(), Error> {
190190+ use chrono::DateTime;
190191 use pastemyst::paste::*;
191192 use pastemyst::str;
192193 use poise::serenity_prelude::User;
···381382382383 #[allow(clippy::cast_possible_truncation)]
383384 // this shouldn't be able to break but just in case I'm making the `unwrap_or` output NaiveDateTime::MIN
384384- let date_time_stamp = chrono::NaiveDateTime::from_timestamp_opt(unix_timecode as i64, 0)
385385- .unwrap_or(chrono::NaiveDateTime::MIN);
385385+ let date_time_stamp = DateTime::from_timestamp(unix_timecode as i64, 0).unwrap_or(DateTime::UNIX_EPOCH);
386386387387 let age = chrono::Utc::now()
388388 .naive_utc()
389389- .signed_duration_since(date_time_stamp)
389389+ .signed_duration_since(date_time_stamp.naive_local())
390390 .num_days();
391391392392 let is_user_in_db: Option<String> = check_username_against_db(ctx.author().id.0).await.unwrap();
···626626 BlacklistOutput,
627627 >,
628628) -> Result<(), Error> {
629629+ use chrono::DateTime;
630630+629631 ctx.defer().await?;
630632631633 let mut con = open_redis_connection().await?;
···929931930932 #[allow(clippy::cast_possible_truncation)]
931933 // this shouldn't be able to break but just in case I'm making the `unwrap_or` output NaiveDateTime::MIN
932932- let date_time_stamp = chrono::NaiveDateTime::from_timestamp_opt(unix_timecode as i64, 0)
933933- .unwrap_or(chrono::NaiveDateTime::MIN);
934934+ let date_time_stamp = DateTime::from_timestamp(unix_timecode as i64, 0).unwrap_or(DateTime::UNIX_EPOCH);
934935935936 let age = chrono::Utc::now()
936937 .naive_utc()
937937- .signed_duration_since(date_time_stamp)
938938+ .signed_duration_since(date_time_stamp.naive_local())
938939 .num_days();
939940940941 let is_user_in_db: Option<String> =
+6-6
src/commands/tools.rs
···11-use chrono::NaiveDateTime;
11+use chrono::DateTime;
22use poise::serenity_prelude::{self as serenity, AttachmentType, RichInvite};
33use rusted_fbt_lib::{
44 checks::guild_auth_check,
···2626 #[allow(clippy::cast_possible_truncation)]
2727 // this shouldn't be able to break but just in case I'm making the `unwrap_or` output NaiveDateTime::MIN
2828 let date_time_stamp =
2929- NaiveDateTime::from_timestamp_opt(unix_timecode as i64, 0).unwrap_or(NaiveDateTime::MIN);
2929+ DateTime::from_timestamp(unix_timecode as i64, 0).unwrap_or(DateTime::UNIX_EPOCH);
30303131 let age = chrono::Utc::now()
3232 .naive_utc()
3333- .signed_duration_since(date_time_stamp)
3333+ .signed_duration_since(date_time_stamp.naive_local())
3434 .num_days();
35353636 ctx.say(format!(
···5656 #[allow(clippy::cast_possible_truncation)]
5757 // this shouldn't be able to break but just in case I'm making the `unwrap_or` output NaiveDateTime::MIN
5858 let date_time_stamp =
5959- NaiveDateTime::from_timestamp_opt(unix_timecode as i64, 0).unwrap_or(NaiveDateTime::MIN);
5959+ DateTime::from_timestamp(unix_timecode as i64, 0).unwrap_or(DateTime::UNIX_EPOCH);
60606161 ctx.say(format!("Created/Joined on {date_time_stamp}"))
6262 .await?;
···277277 #[allow(clippy::cast_possible_truncation)]
278278 // this shouldn't be able to break but just in case I'm making the `unwrap_or` output NaiveDateTime::MIN
279279 let date_time_stamp =
280280- NaiveDateTime::from_timestamp_opt(unix_timecode as i64, 0).unwrap_or(NaiveDateTime::MIN);
280280+ DateTime::from_timestamp(unix_timecode as i64, 0).unwrap_or(DateTime::UNIX_EPOCH);
281281282282 let age = chrono::Utc::now()
283283 .naive_utc()
284284- .signed_duration_since(date_time_stamp)
284284+ .signed_duration_since(date_time_stamp.naive_local())
285285 .num_days();
286286287287 let is_user_in_db: Option<String> =
+5-4
src/lib/event_handlers.rs
···11use crate::structs::{GuildSettings, UserInfo, WaybackResponse, WaybackStatus};
22use crate::utils::snowflake_to_unix;
33use crate::vars::FBT_GUILD_ID;
44-use chrono::NaiveDateTime;
44+// use chrono::NaiveDateTime;
55use chrono::Utc;
66use chrono_tz::Australia::Melbourne;
77use colored::Colorize;
···9090 ctx: &serenity::Context,
9191 member: &serenity::Member,
9292) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
9393+ use chrono::DateTime;
9494+9395 use crate::utils::open_redis_connection;
9496 use std::collections::HashSet;
9597···133135134136 #[allow(clippy::pedantic)]
135137 // it literally only take's i64, no need to warn about truncation here.
136136- let date_time_stamp = NaiveDateTime::from_timestamp_opt(unix_timecode as i64, 0)
137137- .unwrap_or(NaiveDateTime::MIN);
138138+ let date_time_stamp = DateTime::from_timestamp(unix_timecode as i64, 0).unwrap_or(DateTime::UNIX_EPOCH);
138139139140 let age = chrono::Utc::now()
140141 .naive_utc()
141141- .signed_duration_since(date_time_stamp)
142142+ .signed_duration_since(date_time_stamp.naive_local())
142143 .num_days();
143144144145 // Compare user age
+1-1
src/lib/memes.rs
···3636 let mut hits: Vec<&str> = Vec::new();
37373838 for word in words {
3939- POG_RE.find(word).map_or((), |pog| {
3939+ let _ = POG_RE.find(word).map_or((), |pog| {
4040 hits.push(pog.as_str());
4141 });
4242 }