Created
June 7, 2018 10:03
-
-
Save EasyThe/d9422e82e5dd51f64b626b03ce3db946 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Discord.Net.Providers.WS4Net; | |
using Discord.WebSocket; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Discord; | |
namespace ThothBot | |
{ | |
class Program | |
{ | |
DiscordSocketClient _client; | |
CommandHandler _handler; | |
static void Main(string[] args) | |
=> new Program().StartAsync().GetAwaiter().GetResult(); | |
public async Task StartAsync() | |
{ | |
if (Config.bot.token == "" || Config.bot.token == null) return; | |
_client = new DiscordSocketClient(new DiscordSocketConfig | |
{ | |
LogLevel = LogSeverity.Verbose, | |
WebSocketProvider = WS4NetProvider.Instance | |
}); | |
_client.Log += Log; | |
await _client.LoginAsync(TokenType.Bot, Config.bot.token); | |
await _client.StartAsync(); | |
_handler = new CommandHandler(); | |
await _handler.InitializeAsync(_client); | |
await Task.Delay(-1); | |
} | |
private async Task Log(LogMessage msg) | |
{ | |
Console.WriteLine(msg.Message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment