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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user