2020-10-06 11:02:09 +00:00
|
|
|
pub const DAY: u64 = 86_400;
|
2022-02-19 18:21:11 +00:00
|
|
|
pub const HOUR: u64 = 3_600;
|
|
|
|
pub const MINUTE: u64 = 60;
|
2022-02-19 13:28:24 +00:00
|
|
|
|
2022-09-17 11:37:58 +00:00
|
|
|
pub const EMBED_DESCRIPTION_MAX_LENGTH: usize = 4096;
|
2021-09-27 16:34:13 +00:00
|
|
|
pub const SELECT_MAX_ENTRIES: usize = 25;
|
2020-10-11 16:41:26 +00:00
|
|
|
|
|
|
|
pub const CHARACTERS: &str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_";
|
|
|
|
|
2020-10-13 13:35:13 +00:00
|
|
|
const THEME_COLOR_FALLBACK: u32 = 0x8fb677;
|
2022-02-19 14:32:03 +00:00
|
|
|
pub const MACRO_MAX_COMMANDS: usize = 5;
|
2020-10-13 13:35:13 +00:00
|
|
|
|
2021-10-13 15:37:15 +00:00
|
|
|
use std::{collections::HashSet, env, iter::FromIterator};
|
|
|
|
|
2022-09-08 16:58:05 +00:00
|
|
|
use poise::serenity_prelude::model::prelude::AttachmentType;
|
2021-10-26 20:10:14 +00:00
|
|
|
use regex::Regex;
|
2021-10-13 15:37:15 +00:00
|
|
|
|
|
|
|
lazy_static! {
|
|
|
|
pub static ref DEFAULT_AVATAR: AttachmentType<'static> = (
|
2021-10-26 20:10:14 +00:00
|
|
|
include_bytes!(concat!(
|
|
|
|
env!("CARGO_MANIFEST_DIR"),
|
|
|
|
"/assets/",
|
|
|
|
env!("WEBHOOK_AVATAR", "WEBHOOK_AVATAR not provided for compilation")
|
|
|
|
)) as &[u8],
|
|
|
|
env!("WEBHOOK_AVATAR"),
|
|
|
|
)
|
|
|
|
.into();
|
2020-11-29 00:36:42 +00:00
|
|
|
pub static ref REGEX_CHANNEL_USER: Regex = Regex::new(r#"\s*<(#|@)(?:!)?(\d+)>\s*"#).unwrap();
|
2020-10-12 20:01:27 +00:00
|
|
|
pub static ref SUBSCRIPTION_ROLES: HashSet<u64> = HashSet::from_iter(
|
2023-03-24 17:44:43 +00:00
|
|
|
env::var("PATREON_ROLE_ID")
|
2020-10-12 20:01:27 +00:00
|
|
|
.map(|var| var
|
2020-10-11 16:41:26 +00:00
|
|
|
.split(',')
|
2020-10-12 20:01:27 +00:00
|
|
|
.filter_map(|item| { item.parse::<u64>().ok() })
|
|
|
|
.collect::<Vec<u64>>())
|
2021-07-17 16:00:47 +00:00
|
|
|
.unwrap_or_else(|_| Vec::new())
|
2020-10-12 20:01:27 +00:00
|
|
|
);
|
2021-10-26 20:10:14 +00:00
|
|
|
pub static ref CNC_GUILD: Option<u64> =
|
2023-03-24 17:44:43 +00:00
|
|
|
env::var("PATREON_GUILD_ID").map(|var| var.parse::<u64>().ok()).ok().flatten();
|
2022-05-13 22:08:52 +00:00
|
|
|
pub static ref MIN_INTERVAL: i64 =
|
|
|
|
env::var("MIN_INTERVAL").ok().and_then(|inner| inner.parse::<i64>().ok()).unwrap_or(600);
|
2020-10-12 20:01:27 +00:00
|
|
|
pub static ref MAX_TIME: i64 = env::var("MAX_TIME")
|
|
|
|
.ok()
|
2022-05-13 22:08:52 +00:00
|
|
|
.and_then(|inner| inner.parse::<i64>().ok())
|
2020-10-12 20:01:27 +00:00
|
|
|
.unwrap_or(60 * 60 * 24 * 365 * 50);
|
|
|
|
pub static ref LOCAL_TIMEZONE: String =
|
|
|
|
env::var("LOCAL_TIMEZONE").unwrap_or_else(|_| "UTC".to_string());
|
2021-10-26 20:10:14 +00:00
|
|
|
pub static ref THEME_COLOR: u32 = env::var("THEME_COLOR")
|
|
|
|
.map_or(THEME_COLOR_FALLBACK, |inner| u32::from_str_radix(&inner, 16)
|
|
|
|
.unwrap_or(THEME_COLOR_FALLBACK));
|
2021-01-13 19:19:55 +00:00
|
|
|
pub static ref PYTHON_LOCATION: String =
|
|
|
|
env::var("PYTHON_LOCATION").unwrap_or_else(|_| "venv/bin/python3".to_string());
|
2020-10-11 16:41:26 +00:00
|
|
|
}
|