safeguard commands
This commit is contained in:
@@ -57,6 +57,7 @@ fn send_text_message(
|
||||
// target_player_id: player_id,
|
||||
};
|
||||
|
||||
println!("> {}", message);
|
||||
client.send_chat(request).await.ok();
|
||||
});
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user