Interface PermissionsProvider

All Known Implementing Classes:
DefaultPermissionsProvider

public interface PermissionsProvider
Interface for performing permission checks.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    hasPermission(@NotNull net.dv8tion.jda.api.entities.Member member, @NotNull InvocationContext<?> context)
    Checks if a Member has permissions.
    boolean
    hasPermission(@NotNull net.dv8tion.jda.api.entities.User user, @NotNull InvocationContext<?> context)
    Checks if a User has permissions.
  • Method Details

    • hasPermission

      boolean hasPermission(@NotNull @NotNull net.dv8tion.jda.api.entities.User user, @NotNull @NotNull InvocationContext<?> context)
      Checks if a User has permissions. Compared to hasPermission(Member, InvocationContext) this method will be called if the command gets executed in a non-guild context, where no member object is available.
      Parameters:
      user - the User to perform the check against
      context - the corresponding InvocationContext
      Returns:
      true if the user has the permission to execute the command
      See Also:
    • hasPermission

      boolean hasPermission(@NotNull @NotNull net.dv8tion.jda.api.entities.Member member, @NotNull @NotNull InvocationContext<?> context)
      Checks if a Member has permissions.
      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