safeguard commands

This commit is contained in:
AviiNL
2023-12-23 08:53:46 +01:00
parent 8851594537
commit 05f4859f67
14 changed files with 749 additions and 282 deletions

View File

@@ -57,6 +57,7 @@ fn send_text_message(
// target_player_id: player_id,
};
println!("> {}", message);
client.send_chat(request).await.ok();
});

View File

@@ -164,6 +164,7 @@ fn listen_srs(
let voice = radio.voice;
let stt_url = stt_url.as_str().to_string();
radio.handle = Some(tokio.0.spawn(async move {
// todo: add loop here to reconnect on disconnect/errors
let tcp = TcpStream::connect(addr).await?;
let (tcp_stream, tcp_sink) = tcp.into_split();
@@ -469,6 +470,8 @@ fn handle_voice_command(
continue;
};
println!("< {}\n\t{}", rawr.clone(), cmd.clone());
let Ok((_, call)) = parse_call(cmd) else {
// no command, casual conversations?
return;