From efaedac98f306e1d855f6dc6f9efb5dd99eeb554 Mon Sep 17 00:00:00 2001 From: Still Hsu <341464@gmail.com> Date: Sat, 29 Sep 2018 06:20:38 +0800 Subject: [PATCH] docs: Fix for incomplete structure sample (#1145) --- docs/guides/getting_started/samples/intro/structure.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/guides/getting_started/samples/intro/structure.cs b/docs/guides/getting_started/samples/intro/structure.cs index a9a018c3a..5165e2fdb 100644 --- a/docs/guides/getting_started/samples/intro/structure.cs +++ b/docs/guides/getting_started/samples/intro/structure.cs @@ -36,7 +36,7 @@ class Program // you must set the MessageCacheSize. You may adjust the number as needed. //MessageCacheSize = 50, - // If your platform doesn't have native websockets, + // If your platform doesn't have native WebSockets, // add Discord.Net.Providers.WS4Net from NuGet, // add the `using` at the top, and uncomment this line: //WebSocketProvider = WS4NetProvider.Instance @@ -57,7 +57,7 @@ class Program _commands.Log += Log; // Setup your DI container. - _services = ConfigureServices(), + _services = ConfigureServices(); } @@ -116,7 +116,9 @@ class Program await InitCommands(); // Login and connect. - await _client.LoginAsync(TokenType.Bot, /* */); + await _client.LoginAsync(TokenType.Bot, + // < DO NOT HARDCODE YOUR TOKEN > + Environment.GetEnvironmentVariable("DiscordToken")); await _client.StartAsync(); // Wait infinitely so your bot actually stays connected. @@ -160,7 +162,7 @@ class Program // Execute the command. (result does not indicate a return value, // rather an object stating if the command executed successfully). - var result = await _commands.ExecuteAsync(context, pos); + var result = await _commands.ExecuteAsync(context, pos, _services); // Uncomment the following lines if you want the bot // to send a message if it failed.