In this lesson, you’ll learn how to use the Check
object. A Check
is a predicate that is evaluated before a Command
is executed to ensure that the Context
surrounding the Command
invocation is valid.
In an earlier example, you did something similar to verify that the user who sent a message that the bot handles was not the bot user itself. The commands
extension provides a cleaner and more usable mechanism for performing this kind of check, namely using Check
objects.