如何将成员踢出语音频道? (DSharpplus)
How can I kick member from voice channel? (DSharpplus)
如何将成员踢出语音频道?
在 DSharpplus Api 文档中我只找到了 Task PlaceMemberAsync(DiscordMember Member)
或 public Task PlaceInAsync(DiscordChannel channel)
await Member.PlaceInAsync(null)
无效
https://dsharpplus.emzi0767.com/api/index.html
感谢您的回答
来自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.
现在你需要使用
await Member.ModifyAsync(delegate (MemberEditModel Kick)
{
Kick.VoiceChannel = null;
});
如何将成员踢出语音频道?
在 DSharpplus Api 文档中我只找到了 Task PlaceMemberAsync(DiscordMember Member)
或 public Task PlaceInAsync(DiscordChannel channel)
await Member.PlaceInAsync(null)
无效
https://dsharpplus.emzi0767.com/api/index.html
感谢您的回答
来自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.
现在你需要使用
await Member.ModifyAsync(delegate (MemberEditModel Kick)
{
Kick.VoiceChannel = null;
});