You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

joining_audio.cs 497 B

8 years ago
8 years ago
12345678910
  1. [Command("join")]
  2. public async Task JoinChannel(IVoiceChannel channel = null)
  3. {
  4. // Get the audio channel
  5. channel = channel ?? (msg.Author as IGuildUser)?.VoiceChannel;
  6. 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; }
  7. // For the next step with transmitting audio, you would want to pass this Audio Client in to a service.
  8. var audioClient = await channel.ConnectAsync();
  9. }