Browse Source

Added main as proxy task

pull/1797/head
Hitmasu 4 years ago
parent
commit
18a8278dd9
3 changed files with 4 additions and 6 deletions
  1. +1
    -2
      docs/guides/getting_started/samples/first-bot/async-context.cs
  2. +1
    -2
      docs/guides/getting_started/samples/first-bot/complete.cs
  3. +2
    -2
      docs/guides/getting_started/samples/first-bot/structure.cs

+ 1
- 2
docs/guides/getting_started/samples/first-bot/async-context.cs View File

@@ -1,7 +1,6 @@
public class Program public class Program
{ {
public static async Task Main(string[] args)
=> await new Program().MainAsync();
public static Task Main(string[] args) => new Program().MainAsync();


public async Task MainAsync() public async Task MainAsync()
{ {


+ 1
- 2
docs/guides/getting_started/samples/first-bot/complete.cs View File

@@ -2,8 +2,7 @@ public class Program
{ {
private DiscordSocketClient _client; private DiscordSocketClient _client;
public static async Task Main(string[] args)
=> await new Program().MainAsync();
public static Task Main(string[] args) => new Program().MainAsync();


public async Task MainAsync() public async Task MainAsync()
{ {


+ 2
- 2
docs/guides/getting_started/samples/first-bot/structure.cs View File

@@ -10,11 +10,11 @@ using Discord.WebSocket;
class Program class Program
{ {
// Program entry point // Program entry point
static async Task Main(string[] args)
static Task Main(string[] args)
{ {
// Call the Program constructor, followed by the // Call the Program constructor, followed by the
// MainAsync method and wait until it finishes (which should be never). // MainAsync method and wait until it finishes (which should be never).
await new Program().MainAsync();
return new Program().MainAsync();
} }


private readonly DiscordSocketClient _client; private readonly DiscordSocketClient _client;


Loading…
Cancel
Save