You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

connections.cs 578 B

1234567891011121314151617181920212223
  1. using Discord;
  2. using Discord.WebSocket;
  3. public class Program
  4. {
  5. private DiscordSocketClient _client;
  6. static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult();
  7. public async Task MainAsync()
  8. {
  9. _client = new DiscordSocketClient();
  10. await _client.LoginAsync(TokenType.Bot, "bot token");
  11. await _client.StartAsync();
  12. Console.WriteLine("Press any key to exit...");
  13. Console.ReadKey();
  14. await _client.StopAsync();
  15. // Wait a little for the client to finish disconnecting before allowing the program to return
  16. await Task.Delay(500);
  17. }
  18. }