Class DefaultPermissionsProvider
java.lang.Object
com.github.kaktushose.jda.commands.permissions.DefaultPermissionsProvider
- All Implemented Interfaces:
PermissionsProvider
Default implementation of PermissionsProvider
with the following behaviour:
hasPermission(User,InvocationContext)
will always returntrue
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
hasPermission
(@NotNull Member member, @NotNull InvocationContext<?> context) Checks against the default Discord permissions.boolean
hasPermission
(@NotNull User user, @NotNull InvocationContext<?> context) Doesn't perform checks and will always returntrue
.
-
Constructor Details
-
DefaultPermissionsProvider
public DefaultPermissionsProvider()
-
-
Method Details
-
hasPermission
public boolean hasPermission(@NotNull @NotNull User user, @NotNull @NotNull InvocationContext<?> context) Doesn't perform checks and will always returntrue
.- Specified by:
hasPermission
in interfacePermissionsProvider
- Parameters:
user
- theUser
to perform the check againstcontext
- the correspondingInvocationContext
- Returns:
- always
true
- See Also:
-
hasPermission
public boolean hasPermission(@NotNull @NotNull Member member, @NotNull @NotNull InvocationContext<?> context) Checks against the default Discord permissions.
More formally, this method will work with any permission provided by
Permission.values()
, case-insensitive. Any other permission String will be ignored.- Specified by:
hasPermission
in interfacePermissionsProvider
- Parameters:
member
- theMember
to perform the check againstcontext
- the correspondingInvocationContext
- Returns:
true
if the user has the permission to execute the command
-