Class ApplicationCommandPermission

  • All Implemented Interfaces:
    DiscordObject

    public class ApplicationCommandPermission
    extends Object
    implements DiscordObject
    Represents an individual application command permission, allowing you to enable or disable commands for specific users, roles, or channels within a guild.
    • Constructor Detail

      • ApplicationCommandPermission

        public ApplicationCommandPermission​(GatewayDiscordClient gateway,
                                            Snowflake guildId,
                                            discord4j.discordjson.json.ApplicationCommandPermissionsData data)
        Constructs an ApplicationCommandPermission with an associated GatewayDiscordClient and Discord data.
        Parameters:
        gateway - the GatewayDiscordClient associated to this object, must be non-null.
        data - the raw data as represented by Discord, must be non-null.
    • Method Detail

      • appliesToEveryone

        public boolean appliesToEveryone()
        Returns whether this role permission uses a constant representing it applies to everyone.
        Returns:
        true if this permission applies to all members in a guild, false if otherwise
      • appliesToAllChannels

        public boolean appliesToAllChannels()
        Returns whether this channel permission uses a constant representing it applies to all channels.
        Returns:
        true if this permission applies to all channels in a guild, false if otherwise
      • isAllowed

        public boolean isAllowed()
        Returns whether this permission allows or disallows a command for the target given by getType() and getId().
        Returns:
        true if this permission is allowing the command, false if it disallows it.