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:
java.io.Serializable
- Direct Known Subclasses:
MissingAccessException
public class InsufficientPermissionException extends PermissionException
Indicates that the user is missing aPermission
for some action.
-
-
Constructor Summary
Constructors Constructor Description InsufficientPermissionException(GuildChannel channel, Permission permission)
InsufficientPermissionException(GuildChannel channel, Permission permission, java.lang.String reason)
InsufficientPermissionException(Guild guild, Permission permission)
InsufficientPermissionException(Guild guild, Permission permission, java.lang.String reason)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GuildChannel
getChannel(JDA api)
TheGuildChannel
instance for thechannel id
.long
getChannelId()
The id for the responsibleGuildChannel
instance.ChannelType
getChannelType()
TheChannelType
for thechannel id
.Guild
getGuild(JDA api)
long
getGuildId()
The id for the responsibleGuild
instance.-
Methods inherited from class net.dv8tion.jda.api.exceptions.PermissionException
getPermission
-
-
-
-
Constructor Detail
-
InsufficientPermissionException
public InsufficientPermissionException(@Nonnull Guild guild, @Nonnull Permission permission)
-
InsufficientPermissionException
public InsufficientPermissionException(@Nonnull Guild guild, @Nonnull Permission permission, @Nonnull java.lang.String reason)
-
InsufficientPermissionException
public InsufficientPermissionException(@Nonnull GuildChannel channel, @Nonnull Permission permission)
-
InsufficientPermissionException
public InsufficientPermissionException(@Nonnull GuildChannel channel, @Nonnull Permission permission, @Nonnull java.lang.String reason)
-
-
Method Detail
-
getGuildId
public long getGuildId()
The id for the responsibleGuild
instance.- Returns:
- The ID as a long
- Since:
- 4.0.0
- See Also:
JDA.getGuildById(long)
-
getChannelId
public long getChannelId()
The id for the responsibleGuildChannel
instance.- Returns:
- The ID as a long or 0
- Since:
- 4.0.0
- See Also:
getChannel(net.dv8tion.jda.api.JDA)
-
getChannelType
@Nonnull public ChannelType getChannelType()
TheChannelType
for thechannel id
.- Returns:
- The channel type or
ChannelType.UNKNOWN
. - Since:
- 4.0.0
-
getGuild
@Nullable public Guild getGuild(@Nonnull JDA api)
- Parameters:
api
- The shard to perform the lookup in- Returns:
- The Guild instance or null
- Throws:
java.lang.IllegalArgumentException
- If the provided JDA instance is null- Since:
- 4.0.0
-
getChannel
@Nullable public GuildChannel getChannel(@Nonnull JDA api)
TheGuildChannel
instance for thechannel id
.- Parameters:
api
- The shard to perform the lookup in- Returns:
- The GuildChannel instance or null
- Throws:
java.lang.IllegalArgumentException
- If the provided JDA instance is null- Since:
- 4.0.0
-
-