fix: only current uses are activated

This commit is contained in:
silver 2023-09-16 20:03:58 +01:00
parent 3cf298f137
commit 5f9037c69b
4 changed files with 79 additions and 2 deletions

View file

@ -14,6 +14,7 @@ use sqlx::{
};
use std::{env, str::FromStr, sync::Arc};
use tokio::sync::RwLock;
use chrono::{Datelike, SecondsFormat, Utc};
pub struct Config {
pub skynet_server: GuildId,
@ -258,3 +259,13 @@ pub async fn get_server_config_bulk(db: &Pool<Sqlite>) -> Vec<Servers> {
.await
.unwrap_or_default()
}
pub fn get_now_iso(short: bool) -> String {
let now = Utc::now();
if short {
format!("{}-{:02}-{:02}", now.year(), now.month(), now.day())
} else {
now.to_rfc3339_opts(SecondsFormat::Millis, true)
}
}