From f9c95bc4610899fcd286b7d6e930c48cd5c9e9a5 Mon Sep 17 00:00:00 2001 From: Casino Boyale Date: Thu, 8 Nov 2018 15:58:21 +0000 Subject: [PATCH] Got rid of use of undefined variables --- docs/guides/voice/samples/joining_audio.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/voice/samples/joining_audio.cs b/docs/guides/voice/samples/joining_audio.cs index 3abbfb6321..8803d35969 100644 --- a/docs/guides/voice/samples/joining_audio.cs +++ b/docs/guides/voice/samples/joining_audio.cs @@ -3,8 +3,8 @@ public async Task JoinChannel(IVoiceChannel channel = null) { // Get the audio channel - channel = channel ?? (msg.Author as IGuildUser)?.VoiceChannel; - if (channel == null) { await msg.Channel.SendMessageAsync("User must be in a voice channel, or a voice channel must be passed as an argument."); return; } + channel = channel ?? (Context.User as IGuildUser)?.VoiceChannel; + if (channel == null) { await Context.Channel.SendMessageAsync("User must be in a voice channel, or a voice channel must be passed as an argument."); return; } // For the next step with transmitting audio, you would want to pass this Audio Client in to a service. var audioClient = await channel.ConnectAsync();