aboutsummaryrefslogtreecommitdiffstats
path: root/src/teamspeak.rs
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-01-26 06:58:42 +0100
committerJokler <jokler@protonmail.com>2020-01-29 20:39:27 +0100
commitaf0a1b81707536caf4e498d86912f65981342072 (patch)
tree6a875cd46bc427544804a14278a90e23a119bfc5 /src/teamspeak.rs
parent32686ba4a31ecf7c9aedad65c1a6be0be7d96ea2 (diff)
downloadpokebot-af0a1b81707536caf4e498d86912f65981342072.tar.gz
pokebot-af0a1b81707536caf4e498d86912f65981342072.zip
Randomly choose from lists of identities and names
Diffstat (limited to 'src/teamspeak.rs')
-rw-r--r--src/teamspeak.rs10
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)