CommandPermissionChecker
public protocol CommandPermissionChecker
Check if the given user has the permission to execute the command.
let checker = MyChecker()
guard checker.check(user, canUse: command, on: event) else { throw CommandError.InvalidPermissions }
-
Check if the given user has the permission to execute the command.
let checker = MyChecker() guard checker.check(user, canUse: command, on: event) else { throw CommandError.InvalidPermissions }Declaration
Swift
func check(_ user: Userable, canUse command: _ExecutableCommand, on event: CommandEvent) -> BoolParameters
userUser executing the command
commandCommand being executed
eventEvent holding the command & related info
Return Value
Wether or not the user is allowed to execute the command
View on GitHub
CommandPermissionChecker Protocol Reference