diff options
Diffstat (limited to 'src/teamspeak.rs')
| -rw-r--r-- | src/teamspeak.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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) |
