Files
Discord.Net/docs/guides/concepts/samples/connections.cs
Christopher F 3a60c58697 Rewrite all concepts documentation
hello RC documentation
2017-04-03 18:46:00 -04:00

23 lines
578 B
C#

using Discord;
using Discord.WebSocket;
public class Program
{
private DiscordSocketClient _client;
static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult();
public async Task MainAsync()
{
_client = new DiscordSocketClient();
await _client.LoginAsync(TokenType.Bot, "bot token");
await _client.StartAsync();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
await _client.StopAsync();
// Wait a little for the client to finish disconnecting before allowing the program to return
await Task.Delay(500);
}
}