From 2f07eaee7e48f525fae31b53ced77badeec8a39e Mon Sep 17 00:00:00 2001 From: Torsten Date: Fri, 9 Sep 2016 17:31:22 +0200 Subject: [PATCH 1/2] Add joinvoice / leavevoice commands --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 21daf17..79cb940 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,6 +154,12 @@ fn main() { let text = "Bye ".to_string() + &message.author.name + "."; let _ = discord.send_message(&message.channel_id, &text, "", false); break; + } else if message.content == "!joinvoice" { + let voice_handle = connection.voice(server_id); + voice_handle.connect(voice_channel_id); + } else if message.content == "!leavevoice" { + let voice_handle = connection.voice(server_id); + voice_handle.disconnect(); } else if message.content.starts_with("!") { let command_name: &str = &message.content[1..]; play_sound(command_name, &mut connection, &server_id); From 4c86e20c30c504eaa9bb31756d3b43cdafd1f855 Mon Sep 17 00:00:00 2001 From: Torsten Date: Fri, 9 Sep 2016 17:32:00 +0200 Subject: [PATCH 2/2] Remove printing what users are in voice channel to avoid rate limit failing --- src/main.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 79cb940..7106478 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,9 +83,6 @@ fn sync_voice_user_state(has_synced: &mut bool, voice_users: &mut HashSet