using System.Threading.Tasks;
DiscordSocketClient client;
public static void Main(string[] args)
=> new Program().MainAsync().GetAwaiter().GetResult();
private async Task MainAsync()
client = new DiscordSocketClient();
client.MessageReceived += CommandHandler;
var token = "MTA3OTg3MTc0Njg1NDg4NzQ1NQ.Gd-BAu.3E0ASLmMIyJ0e85tftC9juR7Ipzlo9ox3LHads";
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
private Task CommandHandler(SocketMessage msg)
msg.Channel.SendMessageAsync($"Hello, {msg.Timestamp}");
return Task.CompletedTask;
private Task Log(LogMessage msg)
Console.WriteLine(msg.ToString());
return Task.CompletedTask;