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.

logging.cs 623 B

1234567891011121314151617181920212223242526
  1. using Discord;
  2. using Discord.Rest;
  3. public class Program
  4. {
  5. private DiscordSocketClient _client;
  6. static void Main(string[] args) => new Program().Start().GetAwaiter().GetResult();
  7. public async Task Start()
  8. {
  9. _client = new DiscordSocketClient(new DiscordSocketConfig() {
  10. LogLevel = LogSeverity.Info
  11. });
  12. _client.Log += (message) =>
  13. {
  14. Console.WriteLine($"{message.ToString()}");
  15. return Task.CompletedTask;
  16. };
  17. await _client.LoginAsync(TokenType.Bot, "bot token");
  18. await _client.ConnectAsync();
  19. await Task.Delay(-1);
  20. }
  21. }