我正在創建一個不和諧的機器人,並且我正在努力弄清楚如何踢用戶。我無法找到關於此的代碼或文檔。下面的代碼在CS中通過機器人K Disc不和用戶
private void MuteUserCommand()
{
commands.CreateCommand("stfu")
.Parameter("PersonToKick", ParameterType.Required)
.Do(async (e) =>
{
string persontomute = e.GetArg("PersonToKick");
if (e.User.ServerPermissions.MuteMembers == false)
{
await e.Channel.SendMessage("Yoo cahnot tells " + persontomute + " to shut up, iz not enuff poweh!");
}
else
{
await e.Channel.SendMessage("Shut up " + persontomute + "!");
//How do I kick persontomute here?
}
});
}
更新:我使用Discord.NET 0.9.6
什麼函數在'e.Channel'下可用? – ColinM
FindUsers是其中的一個功能,但我不知道如何使用它。 – NodziGames
請更新您的原文,並告訴我們您正在使用什麼Discord .NET Framework – ColinM