2024-10-21 17:36:18 +11:00
|
|
|
use std::sync::LazyLock;
|
|
|
|
|
|
|
|
pub struct ConfigMeta {
|
2024-11-27 21:50:28 +11:00
|
|
|
pub env: &'static str,
|
2024-10-21 17:36:18 +11:00
|
|
|
pub embed_color: u32,
|
|
|
|
pub rustbot_logs: u64,
|
|
|
|
pub developers: Vec<u64>
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "production")]
|
|
|
|
pub static BINARY_PROPERTIES: LazyLock<ConfigMeta> = LazyLock::new(ConfigMeta::new);
|
|
|
|
|
|
|
|
#[cfg(not(feature = "production"))]
|
|
|
|
pub static BINARY_PROPERTIES: LazyLock<ConfigMeta> = LazyLock::new(||
|
|
|
|
ConfigMeta::new()
|
2024-11-27 21:50:28 +11:00
|
|
|
.env("dev")
|
2024-10-21 17:36:18 +11:00
|
|
|
.embed_color(0xf1d63c)
|
|
|
|
);
|
|
|
|
|
|
|
|
impl ConfigMeta {
|
|
|
|
fn new() -> Self {
|
|
|
|
Self {
|
2024-11-27 21:50:28 +11:00
|
|
|
env: "prod",
|
2024-10-21 17:36:18 +11:00
|
|
|
embed_color: 0xf1d63c,
|
2024-11-27 21:50:28 +11:00
|
|
|
rustbot_logs: 1311282815601741844,
|
2024-10-21 17:36:18 +11:00
|
|
|
developers: vec![
|
|
|
|
190407856527376384 // toast.ts
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Scalable functions below;
|
|
|
|
#[cfg(not(feature = "production"))]
|
2024-11-27 21:50:28 +11:00
|
|
|
fn env(mut self, env: &'static str) -> Self {
|
2024-10-21 17:36:18 +11:00
|
|
|
self.env = env;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(not(feature = "production"))]
|
|
|
|
fn embed_color(mut self, color: u32) -> Self {
|
|
|
|
self.embed_color = color;
|
|
|
|
self
|
|
|
|
}
|
|
|
|
}
|