docs: add example of custom error message to sample

This commit is contained in:
Christopher Felegy
2018-12-02 13:36:54 -05:00
parent 5677f23e9a
commit 6d3d906e60

View File

@@ -59,5 +59,10 @@ namespace _02_commands_framework.Modules
[Command("list")]
public Task ListAsync(params string[] objects)
=> ReplyAsync("You listed: " + string.Join("; ", objects));
[Command("guild_only")]
[RequireContext(ContextType.Guild, ErrorMessage = "Sorry, this command must be ran from within a server, not a DM!")]
public Task GuildOnlyCommand()
=> ReplyAsync("Nothing to see here!");
}
}