Browse Source

Updated code

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

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

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


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


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

@@ -2,8 +2,8 @@ public class Program
{ {
private DiscordSocketClient _client; private DiscordSocketClient _client;
public static void Main(string[] args)
=> new Program().MainAsync().GetAwaiter().GetResult();
public static async Task Main(string[] args)
=> await 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 void Main(string[] args)
static async 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).
new Program().MainAsync().GetAwaiter().GetResult();
await new Program().MainAsync();
} }


private readonly DiscordSocketClient _client; private readonly DiscordSocketClient _client;


Loading…
Cancel
Save