From af0a1b81707536caf4e498d86912f65981342072 Mon Sep 17 00:00:00 2001 From: Jokler Date: Sun, 26 Jan 2020 06:58:42 +0100 Subject: Randomly choose from lists of identities and names --- src/teamspeak.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/teamspeak.rs') diff --git a/src/teamspeak.rs b/src/teamspeak.rs index f49f7a6..5dd80ba 100644 --- a/src/teamspeak.rs +++ b/src/teamspeak.rs @@ -197,6 +197,16 @@ impl TeamSpeakConnection { ); } + pub fn send_message_to_user(&self, id: ClientId, text: &str) { + tokio::spawn( + self.conn + .lock() + .to_mut() + .send_message(MessageTarget::Client(id), text) + .map_err(|e| error!("Failed to send message: {}", e)), + ); + } + pub fn disconnect(&self, reason: &str) { let opt = DisconnectOptions::new() .reason(Reason::Clientdisconnect) -- cgit v1.2.3-70-g09d2