use of net.dv8tion.jda.api.events.guild.UnavailableGuildJoinedEvent in project JDA by DV8FromTheWorld.
the class GuildSetupNode method handleCreate.
void handleCreate(DataObject obj) {
if (partialGuild == null) {
partialGuild = obj;
} else {
for (String key : obj.keys()) {
partialGuild.put(key, obj.opt(key).orElse(null));
}
}
boolean unavailable = partialGuild.getBoolean("unavailable");
boolean wasMarkedUnavailable = this.markedUnavailable;
this.markedUnavailable = unavailable;
if (unavailable) {
if (!firedUnavailableJoin && isJoin()) {
firedUnavailableJoin = true;
JDAImpl api = getController().getJDA();
api.handleEvent(new UnavailableGuildJoinedEvent(api, api.getResponseTotal(), id));
}
return;
}
ensureMembers();
}
Aggregations