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
ConstructorDescriptionInsufficientPermissionException
(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) TheGuildChannel
instance for thechannel id
.long
The id for the responsibleGuildChannel
instance.TheChannelType
for thechannel id
.long
The id for the responsibleGuild
instance.Methods inherited from class net.dv8tion.jda.api.exceptions.PermissionException
getPermission
Methods 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 responsibleGuild
instance.- Returns:
- The ID as a long
- Since:
- 4.0.0
- See Also:
-
getChannelId
public long getChannelId()The id for the responsibleGuildChannel
instance.- Returns:
- The ID as a long or 0
- Since:
- 4.0.0
- See Also:
-
getChannelType
TheChannelType
for 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
TheGuildChannel
instance 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
-