Rustbot/library/src/config.rs

45 lines
948 B
Rust
Raw Normal View History

use std::sync::LazyLock;
pub struct ConfigMeta {
2024-11-27 21:50:28 +11:00
pub env: &'static str,
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")
.embed_color(0xf1d63c)
);
impl ConfigMeta {
fn new() -> Self {
Self {
2024-11-27 21:50:28 +11:00
env: "prod",
embed_color: 0xf1d63c,
2024-11-27 21:50:28 +11:00
rustbot_logs: 1311282815601741844,
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 {
self.env = env;
self
}
#[cfg(not(feature = "production"))]
fn embed_color(mut self, color: u32) -> Self {
self.embed_color = color;
self
}
}