26 lines
536 B
Rust
26 lines
536 B
Rust
use serde::{Deserialize, Serialize};
|
|
use std::sync::Arc;
|
|
use tokio::sync::Mutex;
|
|
|
|
#[derive(Serialize, Deserialize, Clone, Debug)]
|
|
pub struct Config {
|
|
#[serde(skip_serializing)]
|
|
pub revolt_token: String,
|
|
|
|
pub furbooru_bot_owner: String,
|
|
#[serde(skip_serializing)]
|
|
pub furbooru_token: String,
|
|
}
|
|
|
|
impl Config {
|
|
pub fn make(&self) -> Arc<Mutex<Config>> {
|
|
Arc::new(Mutex::new(self.clone()))
|
|
}
|
|
}
|
|
|
|
pub struct ConfigKey;
|
|
|
|
impl robespierre::typemap::Key for ConfigKey {
|
|
type Value = Arc<Mutex<Config>>;
|
|
}
|