Expose ts-server password, fix channel-password

Signed-off-by: Aron Heinecke <aron.heinecke@t-online.de>
This commit is contained in:
Aron Heinecke 2021-09-10 19:22:58 +02:00
parent 3e5d6a56b0
commit 0bb7e5e2d2
2 changed files with 8 additions and 1 deletions

View file

@ -5,6 +5,9 @@ teamspeak_server = "IP:PORT" # NO tsdns
# identity, should change this # identity, should change this
teamspeak_identity = "MG0DAgeAAgEgAiAIXJBlj1hQbaH0Eq0DuLlCmH8bl+veTAO2+k9EQjEYSgIgNnImcmKo7ls5mExb6skfK2Tw+u54aeDr0OP1ITsC/50CIA8M5nmDBnmDM/gZ//4AAAAAAAAAAAAAAAAAAAAZRzOI" teamspeak_identity = "MG0DAgeAAgEgAiAIXJBlj1hQbaH0Eq0DuLlCmH8bl+veTAO2+k9EQjEYSgIgNnImcmKo7ls5mExb6skfK2Tw+u54aeDr0OP1ITsC/50CIA8M5nmDBnmDM/gZ//4AAAAAAAAAAAAAAAAAAAAZRzOI"
# teamspeak server password
# teamspeak_server_password = "my secret"
# use either of the following # use either of the following
# join ts-channel by ID # join ts-channel by ID
# teamspeak_channel_id = 1 # teamspeak_channel_id = 1

View file

@ -38,6 +38,7 @@ struct Config {
discord_token: String, discord_token: String,
teamspeak_server: String, teamspeak_server: String,
teamspeak_identity: String, teamspeak_identity: String,
teamspeak_server_password: Option<String>,
teamspeak_channel_id: Option<u64>, teamspeak_channel_id: Option<u64>,
teamspeak_channel_name: Option<String>, teamspeak_channel_name: Option<String>,
teamspeak_channel_password: Option<String>, teamspeak_channel_password: Option<String>,
@ -188,9 +189,12 @@ async fn main() -> Result<()> {
if let Some(channel) = config.teamspeak_channel_name { if let Some(channel) = config.teamspeak_channel_name {
con_config = con_config.channel(channel); 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); 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. // 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!"); let id = Identity::new_from_str(&config.teamspeak_identity).expect("Can't load identity!");