!m mv moves the bot to your voice channel (works only if music is playing)

This commit is contained in:
Master Kwoth
2016-02-14 19:35:00 +01:00
parent f62d9d0d79
commit 5901e25c42
2 changed files with 18 additions and 7 deletions

View File

@ -9,6 +9,7 @@ using NadekoBot.Classes.Music;
using Timer = System.Timers.Timer;
using System.Threading.Tasks;
using NadekoBot.Classes;
using Discord.Audio;
namespace NadekoBot.Modules {
class Music : DiscordModule {
@ -196,6 +197,16 @@ namespace NadekoBot.Modules {
await QueueSong(e, e.GetArg("radio_link"), radio: true);
});
cgb.CreateCommand("mv")
.Description("Moves the bot to your voice channel. (works only if music is already playing)")
.Do(async e => {
MusicControls mc;
if (e.User.VoiceChannel == null || e.User.VoiceChannel.Server != e.Server || !musicPlayers.TryGetValue(e.Server,out mc))
return;
mc.VoiceChannel = e.User.VoiceChannel;
mc.VoiceClient = await mc.VoiceChannel.JoinAudio();
});
cgb.CreateCommand("debug")
.Description("Writes some music data to console. **BOT OWNER ONLY**")
.Do(e => {