Browse Source

Got rid of use of undefined variables

tags/2.0
Casino Boyale Monica S 6 years ago
parent
commit
f9c95bc461
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      docs/guides/voice/samples/joining_audio.cs

+ 2
- 2
docs/guides/voice/samples/joining_audio.cs View File

@@ -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();


Loading…
Cancel
Save