docs: Clarify command samples (#1257)

* Clarify command samples by adding additional notes about each methods

* Add additional notes for the Program class

* Change wording on token read

* Change prefix sample to match referenced example

Co-Authored-By: Still34 <341464@gmail.com>
This commit is contained in:
Still Hsu
2019-03-17 02:49:53 +08:00
committed by Christopher F
parent 377622b2a8
commit 2473619e63
3 changed files with 19 additions and 4 deletions

View File

@@ -37,10 +37,12 @@ namespace _02_commands_framework
client.Log += LogAsync;
services.GetRequiredService<CommandService>().Log += LogAsync;
// Tokens should be considered secret data, and never hard-coded.
// Tokens should be considered secret data and never hard-coded.
// We can read from the environment variable to avoid hardcoding.
await client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("token"));
await client.StartAsync();
// Here we initialize the logic required to register our commands.
await services.GetRequiredService<CommandHandlingService>().InitializeAsync();
await Task.Delay(-1);