Fix Connect() not waiting for ConnectionState to update

This commit is contained in:
Cyberboss
2017-09-22 19:28:47 -04:00
parent c246697888
commit b52ff73bb9
+2 -1
View File
@@ -2,7 +2,7 @@ using Discord;
using Discord.WebSocket;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using TGServiceInterface;
@@ -92,6 +92,7 @@ namespace TGServerService
SeenPrivateChannels.Clear();
client.LoginAsync(TokenType.Bot, DiscordConfig.BotToken).Wait();
client.StartAsync().Wait();
Thread.Sleep(1000); //wait for ConnectionState to update
}
return !Connected() ? "Connection failed!" : null;
}