Package net.dv8tion.jda.api.exceptions
Class InsufficientPermissionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
net.dv8tion.jda.api.exceptions.PermissionException
net.dv8tion.jda.api.exceptions.InsufficientPermissionException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MissingAccessException
Indicates that the user is missing a
Permission for some action.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInsufficientPermissionException(GuildChannel channel, Permission permission) InsufficientPermissionException(GuildChannel channel, Permission permission, String reason) InsufficientPermissionException(Guild guild, Permission permission) InsufficientPermissionException(Guild guild, Permission permission, String reason) -
Method Summary
Modifier and TypeMethodDescriptiongetChannel(JDA api) TheGuildChannelinstance for thechannel id.longThe id for the responsibleGuildChannelinstance.TheChannelTypefor thechannel id.longThe id for the responsibleGuildinstance.Methods inherited from class net.dv8tion.jda.api.exceptions.PermissionException
getPermissionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
InsufficientPermissionException
-
InsufficientPermissionException
-
InsufficientPermissionException
public InsufficientPermissionException(@Nonnull GuildChannel channel, @Nonnull Permission permission) -
InsufficientPermissionException
public InsufficientPermissionException(@Nonnull GuildChannel channel, @Nonnull Permission permission, @Nonnull String reason)
-
-
Method Details
-
getGuildId
public long getGuildId()The id for the responsibleGuildinstance.- Returns:
- The ID as a long
- Since:
- 4.0.0
- See Also:
-
getChannelId
public long getChannelId()The id for the responsibleGuildChannelinstance.- Returns:
- The ID as a long or 0
- Since:
- 4.0.0
- See Also:
-
getChannelType
TheChannelTypefor thechannel id.- Returns:
- The channel type or
ChannelType.UNKNOWN. - Since:
- 4.0.0
-
getGuild
- Parameters:
api- The shard to perform the lookup in- Returns:
- The Guild instance or null
- Throws:
IllegalArgumentException- If the provided JDA instance is null- Since:
- 4.0.0
-
getChannel
TheGuildChannelinstance for thechannel id.- Parameters:
api- The shard to perform the lookup in- Returns:
- The GuildChannel instance or null
- Throws:
IllegalArgumentException- If the provided JDA instance is null- Since:
- 4.0.0
-