将人们转移到语音频道

时间:2019-06-13 13:08:20

标签: c# discord.net

我希望看到这个奇怪的错误,而且我不知道如何解决。

await userName.ModifyAsync(x =>
{

    x.Channel = Program.client.GetChannel(588025239103995904) as IVoiceChannel;

});
  

无法将类型Discord.IVoiceChannel隐式转换为Discord.Optional<Discord.IVoiceChannel>

1 个答案:

答案 0 :(得分:0)

创建一个Optional<T>

await user.ModifyAsync(x =>
{
    var voiceChannel = Program.client.GetChannel(588025239103995904) as IVoiceChannel;
    x.Channel = Optional.Create(voiceChannel);

});