Package net.dv8tion.jda.api.events
Class ReadyEvent
- java.lang.Object
-
- net.dv8tion.jda.api.events.Event
-
- net.dv8tion.jda.api.events.ReadyEvent
-
- All Implemented Interfaces:
GenericEvent
public class ReadyEvent extends Event
Indicates that JDA finished loading all entities.
Before this event was fired all entity related functions were not guaranteed to work as expected.Can be used to indicate when JDA finished populating internal objects and is ready to be used. When this is fired all available entities are cached and accessible.
-
-
Constructor Summary
Constructors Constructor Description ReadyEvent(JDA api, long responseNumber)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getGuildAvailableCount()
Number of available guilds for this session.int
getGuildTotalCount()
Sum of bothgetGuildAvailableCount()
andgetGuildUnavailableCount()
.int
getGuildUnavailableCount()
Number of guilds currently not available to this session
Discord failed to connect these guilds to our gateway and we had to discard them for now.-
Methods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getResponseNumber
-
-
-
-
Constructor Detail
-
ReadyEvent
public ReadyEvent(@Nonnull JDA api, long responseNumber)
-
-
Method Detail
-
getGuildAvailableCount
public int getGuildAvailableCount()
Number of available guilds for this session.
When discord fails to connect guilds for our gateway session they will not be in cache here yet but instead will fire aGuildReadyEvent
later.- Returns:
- Number of available guilds for this session
- See Also:
getGuildTotalCount()
,getGuildUnavailableCount()
-
getGuildUnavailableCount
public int getGuildUnavailableCount()
Number of guilds currently not available to this session
Discord failed to connect these guilds to our gateway and we had to discard them for now. These might become available again later and will then fire aGuildReadyEvent
.- Returns:
- Number of currently unavailable guilds
-
getGuildTotalCount
public int getGuildTotalCount()
Sum of bothgetGuildAvailableCount()
andgetGuildUnavailableCount()
.- Returns:
- Total numbers of guilds known to this JDA session
-
-