docs: use async main
* Removed text async * Updated code * Added main as proxy task
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
=> new Program().MainAsync().GetAwaiter().GetResult();
|
||||
public static Task Main(string[] args) => new Program().MainAsync();
|
||||
|
||||
public async Task MainAsync()
|
||||
{
|
||||
|
||||
@@ -2,8 +2,7 @@ public class Program
|
||||
{
|
||||
private DiscordSocketClient _client;
|
||||
|
||||
public static void Main(string[] args)
|
||||
=> new Program().MainAsync().GetAwaiter().GetResult();
|
||||
public static Task Main(string[] args) => new Program().MainAsync();
|
||||
|
||||
public async Task MainAsync()
|
||||
{
|
||||
|
||||
@@ -10,11 +10,11 @@ using Discord.WebSocket;
|
||||
class Program
|
||||
{
|
||||
// Program entry point
|
||||
static void Main(string[] args)
|
||||
static Task Main(string[] args)
|
||||
{
|
||||
// Call the Program constructor, followed by the
|
||||
// MainAsync method and wait until it finishes (which should be never).
|
||||
new Program().MainAsync().GetAwaiter().GetResult();
|
||||
return new Program().MainAsync();
|
||||
}
|
||||
|
||||
private readonly DiscordSocketClient _client;
|
||||
|
||||
Reference in New Issue
Block a user