Class PermissionCheckContext


  • public final class PermissionCheckContext
    extends java.lang.Object
    Represents a context for checking if a member/user has permission to execute the specified comamnd.
    • Constructor Summary

      Constructors 
      Constructor Description
      PermissionCheckContext​(@NotNull net.dv8tion.jda.api.JDA jda, @NotNull net.dv8tion.jda.api.entities.User user, @Nullable net.dv8tion.jda.api.entities.Guild guild, @Nullable net.dv8tion.jda.api.entities.Member member, @NotNull java.lang.String commandAlias)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.lang.String getCommandAlias()
      Returns the command alias, from which the command was triggered.
      @Nullable net.dv8tion.jda.api.entities.Guild getGuild()
      Returns the Guild instance if the command was executed in a guild.
      @NotNull net.dv8tion.jda.api.JDA getJda()
      Returns the JDA instance, where the command was triggered.
      @Nullable net.dv8tion.jda.api.entities.Member getMember()  
      @NotNull net.dv8tion.jda.api.entities.User getUser()
      Returns the User instance, which executed the command.
      boolean isFromGuild()
      Returns whenever the command was triggered to be executed in a guild.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PermissionCheckContext

        public PermissionCheckContext​(@NotNull
                                      @NotNull net.dv8tion.jda.api.JDA jda,
                                      @NotNull
                                      @NotNull net.dv8tion.jda.api.entities.User user,
                                      @Nullable
                                      @Nullable net.dv8tion.jda.api.entities.Guild guild,
                                      @Nullable
                                      @Nullable net.dv8tion.jda.api.entities.Member member,
                                      @NotNull
                                      @NotNull java.lang.String commandAlias)
    • Method Detail

      • getJda

        @NotNull
        public @NotNull net.dv8tion.jda.api.JDA getJda()
        Returns the JDA instance, where the command was triggered.
        Returns:
        jda
      • getUser

        @NotNull
        public @NotNull net.dv8tion.jda.api.entities.User getUser()
        Returns the User instance, which executed the command.
        Returns:
        command execution triggered message's author
      • getGuild

        @Nullable
        public @Nullable net.dv8tion.jda.api.entities.Guild getGuild()
        Returns the Guild instance if the command was executed in a guild.
        Returns:
        guild or null
      • isFromGuild

        public boolean isFromGuild()
        Returns whenever the command was triggered to be executed in a guild.
        Returns:
        true if from guild, false otherwise
      • getMember

        @Nullable
        public @Nullable net.dv8tion.jda.api.entities.Member getMember()
      • getCommandAlias

        @NotNull
        public @NotNull java.lang.String getCommandAlias()
        Returns the command alias, from which the command was triggered.
        Returns:
        alias