如何踢出语音频道成员? (DSharpplus)

时间:2020-10-13 13:33:09

标签: c# discord dsharp+

如何从语音频道中踢出成员?
在DSharpplus Api文档中,我仅找到Task PlaceMemberAsync(DiscordMember Member)public Task PlaceInAsync(DiscordChannel channel)
await Member.PlaceInAsync(null)不起作用
https://dsharpplus.emzi0767.com/api/index.html
谢谢您的回答

2 个答案:

答案 0 :(得分:1)

来自https://dsharpplus.emzi0767.com/api/DSharpPlus.Entities.DiscordMember.html

有一种方法“ ModifyAsync(String,IEnumerable,Nullable,Nullable,DiscordChannel,String)”

您是否在修改目标用户时尝试使DiscordChannel参数为空?首先使用https://dsharpplus.emzi0767.com/api/DSharpPlus.ChannelType.html检查其是否为语音通道。

答案 1 :(得分:-1)

现在您需要使用

 await Member.ModifyAsync(delegate (MemberEditModel Kick)
 {
     Kick.VoiceChannel = null;
 });