Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update event hierarchy #1952

Merged
merged 6 commits into from Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/net/dv8tion/jda/api/JDABuilder.java
Expand Up @@ -20,6 +20,7 @@
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.events.Event;
import net.dv8tion.jda.api.exceptions.InvalidTokenException;
import net.dv8tion.jda.api.events.session.ReadyEvent;
import net.dv8tion.jda.api.hooks.IEventManager;
import net.dv8tion.jda.api.hooks.VoiceDispatchInterceptor;
import net.dv8tion.jda.api.requests.GatewayIntent;
Expand Down Expand Up @@ -1738,7 +1739,7 @@ public JDABuilder setMaxBufferSize(int bufferSize)
* <p>If you wish to be sure that the {@link net.dv8tion.jda.api.JDA} information is correct, please use
* {@link net.dv8tion.jda.api.JDA#awaitReady() JDA.awaitReady()} or register an
* {@link net.dv8tion.jda.api.hooks.EventListener EventListener} to listen for the
* {@link net.dv8tion.jda.api.events.ReadyEvent ReadyEvent}.
* {@link ReadyEvent ReadyEvent}.
*
* @throws InvalidTokenException
* If the provided token is invalid.
Expand Down
Expand Up @@ -18,24 +18,26 @@

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.events.ReadyEvent;
import net.dv8tion.jda.api.events.session.ReadyEvent;
import net.dv8tion.jda.api.events.session.SessionRecreateEvent;

import javax.annotation.Nonnull;

/**
* Indicates that a {@link net.dv8tion.jda.api.entities.Guild Guild} finished setting up
* Indicates that a {@link Guild} finished setting up
* <br>This event is fired if a guild finished setting up during login phase.
* After this event is fired, JDA will start dispatching events related to this guild.
* This indicates a guild was created and added to the cache. It will be fired for both the initial
* setup and full reconnects (indicated by {@link net.dv8tion.jda.api.events.ReconnectedEvent ReconnectedEvent}).
* setup and full reconnects (indicated by {@link SessionRecreateEvent}).
*
* <p>Can be used to initialize any services that depend on this guild.
*
* <p>When a guild fails to ready up due to Discord outages you will not receive this event.
* Guilds that fail to ready up will either timeout or get marked as unavailable.
* <br>You can use {@link ReadyEvent#getGuildUnavailableCount()} and {@link JDA#getUnavailableGuilds()} to check for unavailable guilds.
* {@link GuildTimeoutEvent} will be fired for guilds that don't ready up and also don't get marked as unavailable by Discord.
* Guilds that timeout will be marked as unavailable by the timeout event, they will <b>not</b> fire a {@link GuildUnavailableEvent} as that event is only indicating that a guild becomes unavailable <b>after</b> ready happened.
* Guilds that timeout will be marked as unavailable by the timeout event,
* they will <b>not</b> fire a {@link GuildUnavailableEvent} as that event is only indicating that a guild becomes unavailable <b>after</b> ready happened.
*/
public class GuildReadyEvent extends GenericGuildEvent
{
Expand Down
Expand Up @@ -18,13 +18,13 @@

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.events.Event;
import net.dv8tion.jda.api.events.ReadyEvent;
import net.dv8tion.jda.api.events.session.ReadyEvent;

import javax.annotation.Nonnull;

/**
* Indicates that a guild failed to ready up and timed out.
* <br>Usually this event will be fired right before a {@link net.dv8tion.jda.api.events.ReadyEvent ReadyEvent}.
* <br>Usually this event will be fired right before a {@link ReadyEvent ReadyEvent}.
*
* <p>This will mark the guild as <b>unavailable</b> and it will not be usable when JDA becomes ready.
* You can check all unavailable guilds with {@link ReadyEvent#getGuildUnavailableCount()} and {@link JDA#getUnavailableGuilds()}.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.