Class DefaultPermissionsProvider

java.lang.Object
com.github.kaktushose.jda.commands.permissions.DefaultPermissionsProvider
All Implemented Interfaces:
PermissionsProvider

public class DefaultPermissionsProvider extends Object implements PermissionsProvider

Default implementation of PermissionsProvider with the following behaviour:

See Also:
  • Constructor Details

    • DefaultPermissionsProvider

      public DefaultPermissionsProvider()
  • Method Details

    • hasPermission

      public boolean hasPermission(@NotNull @NotNull net.dv8tion.jda.api.entities.User user, @NotNull @NotNull InvocationContext<?> context)
      Doesn't perform checks and will always return true.
      Specified by:
      hasPermission in interface PermissionsProvider
      Parameters:
      user - the User to perform the check against
      context - the corresponding InvocationContext
      Returns:
      always true
      See Also:
    • hasPermission

      public boolean hasPermission(@NotNull @NotNull net.dv8tion.jda.api.entities.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 interface PermissionsProvider
      Parameters:
      member - the Member to perform the check against
      context - the corresponding InvocationContext
      Returns:
      true if the user has the permission to execute the command