uberbot/src/config.rs

44 lines
923 B
Rust
Raw Permalink Normal View History

2022-07-28 06:21:17 -05:00
use std::{collections::HashMap, net::SocketAddr};
2022-07-20 16:08:35 -05:00
2022-07-15 10:58:45 -05:00
use serde::Deserialize;
#[derive(Deserialize)]
pub struct UberConfig {
pub log_level: Option<String>,
2022-07-15 10:58:45 -05:00
pub irc: IrcConfig,
2022-07-16 17:05:21 -05:00
pub spotify: Option<SpotifyConfig>,
2022-07-20 03:58:33 -05:00
pub bot: BotConfig,
2022-07-28 06:21:17 -05:00
pub web: Option<HttpConfig>,
2022-07-15 10:58:45 -05:00
}
#[derive(Deserialize)]
pub struct SpotifyConfig {
2022-07-16 17:05:21 -05:00
pub client_id: String,
pub client_secret: String,
2022-07-15 10:58:45 -05:00
}
#[derive(Deserialize)]
pub struct IrcConfig {
pub channels: Vec<String>,
pub host: String,
pub tls: bool,
pub mode: Option<String>,
pub nickname: Option<String>,
pub port: u16,
pub username: String,
}
#[derive(Deserialize)]
pub struct BotConfig {
pub db_path: Option<String>,
pub history_depth: usize,
2022-07-20 03:58:33 -05:00
pub search_limit: Option<usize>,
2022-07-24 05:22:00 -05:00
pub prefixes: Vec<String>,
2022-07-20 03:58:33 -05:00
}
2022-07-20 16:08:35 -05:00
#[derive(Deserialize)]
pub struct HttpConfig {
pub listen: SocketAddr,
2022-07-28 06:21:17 -05:00
pub webhooks: HashMap<String, String>,
2022-07-20 16:08:35 -05:00
}