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 aPermissionfor 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 GuildChannelgetChannel(JDA api)TheGuildChannelinstance for thechannel id.longgetChannelId()The id for the responsibleGuildChannelinstance.ChannelTypegetChannelType()TheChannelTypefor thechannel id.GuildgetGuild(JDA api)longgetGuildId()The id for the responsibleGuildinstance.-
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 responsibleGuildinstance.- Returns:
- The ID as a long
- Since:
- 4.0.0
- See Also:
JDA.getGuildById(long)
-
getChannelId
public long getChannelId()
The id for the responsibleGuildChannelinstance.- 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()
TheChannelTypefor 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)
TheGuildChannelinstance 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
-
-