您最多选择25个标签 标签必须以中文、字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. }