Discord.Net在线获取僵尸程序不起作用

时间:2017-07-20 14:39:59

标签: c# discord discord.net

尝试使用Discord.NET 1.0并遵循foxbot指南

fotbox guide

我使用了这段代码:

using System;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;


namespace MyBot
{
    class Program
    {
        static void Main(string[] args)

        => new Program().StartAsync().GetAwaiter().GetResult();
        private DiscordSocketClient _client;

        public async Task StartAsync()
        {
            _client = new DiscordSocketClient();
            await _client.LoginAsync(TokenType.Bot, "Mzmkl......");
            await _client.StartAsync();
            await Task.Delay(-1);
        }
   }
}

尝试编译并没有让我的机器人在线。我按照步骤,我的机器人包括在内。 Bot included

1 个答案:

答案 0 :(得分:0)

这是System.PlatformNotSupportedException错误。我使用Win7。 解决方案是安装WS4NET并添加:

_client = new DiscordSocketClient(new DiscordSocketConfig { 
    WebSocketProvider = Discord.Net.Providers.WS4Net.WS4NetProvider.Instance
 });