abridged/src/bridge_discord/config.rs

18 lines
378 B
Rust
Raw Normal View History

2023-06-11 02:35:48 +00:00
use std::{collections::HashMap, sync::Arc};
2023-05-25 21:38:17 +00:00
2023-05-24 04:23:36 +00:00
use serde::Deserialize;
2023-05-25 21:38:17 +00:00
use serenity::model::prelude::{WebhookId, ChannelId};
2023-05-24 04:23:36 +00:00
2023-06-11 02:35:48 +00:00
fn default_suffix() -> Arc<str> {
"[d]".into()
}
2023-05-24 04:23:36 +00:00
#[derive(Debug, Deserialize)]
pub struct DiscordConfig {
pub token: String,
2023-05-25 21:38:17 +00:00
#[serde(default)]
pub webhooks: HashMap<ChannelId, WebhookId>,
2023-06-11 02:35:48 +00:00
#[serde(default="default_suffix")]
pub suffix: Arc<str>,
2023-05-24 04:23:36 +00:00
}