From 0bb7e5e2d237f112e912dcc8808453a8db87abeb Mon Sep 17 00:00:00 2001 From: Aron Heinecke Date: Fri, 10 Sep 2021 19:22:58 +0200 Subject: [PATCH] Expose ts-server password, fix channel-password Signed-off-by: Aron Heinecke --- credentials.example.toml | 3 +++ src/main.rs | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/credentials.example.toml b/credentials.example.toml index 046b931..1aa0551 100644 --- a/credentials.example.toml +++ b/credentials.example.toml @@ -5,6 +5,9 @@ teamspeak_server = "IP:PORT" # NO tsdns # identity, should change this teamspeak_identity = "MG0DAgeAAgEgAiAIXJBlj1hQbaH0Eq0DuLlCmH8bl+veTAO2+k9EQjEYSgIgNnImcmKo7ls5mExb6skfK2Tw+u54aeDr0OP1ITsC/50CIA8M5nmDBnmDM/gZ//4AAAAAAAAAAAAAAAAAAAAZRzOI" +# teamspeak server password +# teamspeak_server_password = "my secret" + # use either of the following # join ts-channel by ID # teamspeak_channel_id = 1 diff --git a/src/main.rs b/src/main.rs index a7ef947..36ce573 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,6 +38,7 @@ struct Config { discord_token: String, teamspeak_server: String, teamspeak_identity: String, + teamspeak_server_password: Option, teamspeak_channel_id: Option, teamspeak_channel_name: Option, teamspeak_channel_password: Option, @@ -188,9 +189,12 @@ async fn main() -> Result<()> { if let Some(channel) = config.teamspeak_channel_name { con_config = con_config.channel(channel); } - if let Some(password) = config.teamspeak_channel_password { + if let Some(password) = config.teamspeak_server_password { con_config = con_config.password(password); } + if let Some(password) = config.teamspeak_channel_password { + con_config = con_config.channel_password(password); + } // teamspeak: Optionally set the key of this client, otherwise a new key is generated. let id = Identity::new_from_str(&config.teamspeak_identity).expect("Can't load identity!");