diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs index 47d6de7..ade4d2b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -22,6 +22,8 @@ pub struct Config { pub zip: bool, /// Option Discord information for bot postings. pub discord: Option<Discord>, + /// Optional Matrix information for bot postings. + pub matrix: Option<Matrix>, } /// Configuration pertaining to the Discord posting. @@ -33,6 +35,21 @@ pub struct Discord { pub channel_id: u64, } +/// Configuration pertaining to the Matrix posting. +#[derive(Debug, Clone, Deserialize)] +pub struct Matrix { + /// Matrix homeserver. + pub homeserver: String, + /// Matrix username. + pub username: String, + /// Matrix password. + pub password: String, + /// Device ID, or None if a new one should be generated. + pub device_id: Option<String>, + /// Room ID where the message should be posted to. + pub room_id: String, +} + /// Attempt to load the configuration from the given file. pub fn load<P: AsRef<Path>>(path: P) -> Result<Config> { let content = fs::read(path)?; |