Files
Discord.Net/docs/guides/samples/intro/client.cs
Christopher F d111214bff Added new getting started guide
Thanks @MinnDevelopment for his awesome work on
the JDA guide that had no influence here at all.
2017-03-11 15:32:14 -05:00

16 lines
355 B
C#

// Program.cs
using Discord.WebSocket;
// ...
public async Task MainAsync()
{
var client = new DiscordSocketClient();
client.Log += Log;
string token = "abcdefg..."; // Remember to keep this private!
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
// Block this task until the program is closed.
await Task.Delay(-1);
}