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