Browse Source

Update complete.cs

pull/752/head^2
Alex Gravely GitHub 8 years ago
parent
commit
7ade35f549
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      docs/guides/getting_started/samples/intro/complete.cs

+ 6
- 6
docs/guides/getting_started/samples/intro/complete.cs View File

@@ -7,21 +7,21 @@ namespace MyBot
{ {
public class Program public class Program
{ {
private DiscordSocketClient client;
private DiscordSocketClient _client;
public static void Main(string[] args) public static void Main(string[] args)
=> new Program().MainAsync().GetAwaiter().GetResult(); => new Program().MainAsync().GetAwaiter().GetResult();


public async Task MainAsync() public async Task MainAsync()
{ {
client = new DiscordSocketClient();
_client = new DiscordSocketClient();


client.Log += Log;
client.MessageReceived += MessageReceived;
_client.Log += Log;
_client.MessageReceived += MessageReceived;


string token = "abcdefg..."; // Remember to keep this private! string token = "abcdefg..."; // Remember to keep this private!
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
await _client.LoginAsync(TokenType.Bot, token);
await _client.StartAsync();


// Block this task until the program is closed. // Block this task until the program is closed.
await Task.Delay(-1); await Task.Delay(-1);


Loading…
Cancel
Save