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

@@ -60,6 +60,7 @@ namespace _02_commands_framework.Modules
public Task ListAsync(params string[] objects)
=> ReplyAsync("You listed: " + string.Join("; ", objects));
// Setting a custom ErrorMessage property will help clarify the precondition error
[Command("guild_only")]
[RequireContext(ContextType.Guild, ErrorMessage = "Sorry, this command must be ran from within a server, not a DM!")]
public Task GuildOnlyCommand()