您最多选择25个标签 标签必须以中文、字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

joining_audio.cs 498 B

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. }