Class GenericScheduledEventUpdateEvent<T>
java.lang.Object
net.dv8tion.jda.api.events.Event
net.dv8tion.jda.api.events.guild.GenericGuildEvent
net.dv8tion.jda.api.events.guild.scheduledevent.GenericScheduledEventGatewayEvent
net.dv8tion.jda.api.events.guild.scheduledevent.update.GenericScheduledEventUpdateEvent<T>
- All Implemented Interfaces:
GenericEvent,UpdateEvent<ScheduledEvent,T>
- Direct Known Subclasses:
ScheduledEventUpdateDescriptionEvent,ScheduledEventUpdateEndTimeEvent,ScheduledEventUpdateImageEvent,ScheduledEventUpdateLocationEvent,ScheduledEventUpdateNameEvent,ScheduledEventUpdateStartTimeEvent,ScheduledEventUpdateStatusEvent
public abstract class GenericScheduledEventUpdateEvent<T>
extends GenericScheduledEventGatewayEvent
implements UpdateEvent<ScheduledEvent,T>
A generic gateway event class representing an update of a
All events in
ScheduledEvent entity.
All events in
net.dv8tion.jda.api.events.guild.scheduledevent.update package extend this event and are fired
when a specified field in a ScheduledEvent is updated.
It should be noted that ScheduledEvents are not
actual gateway events found in the net.dv8tion.jda.api.events package, but are rather entities similar to
User or TextChannel objects
representing a scheduled event.
Requirements
These events require the SCHEDULED_EVENTS intent and CacheFlag.SCHEDULED_EVENTS to be enabled.
createDefault(String) and
createLight(String) disable this by default!
Discord does not specifically tell us about the updates, but merely tells us the
ScheduledEvent was updated and gives us the updated ScheduledEvent object.
In order to fire a specific event like this we need to have the old ScheduledEvent cached to compare against.
-
Constructor Summary
ConstructorsConstructorDescriptionGenericScheduledEventUpdateEvent(JDA api, long responseNumber, ScheduledEvent scheduledEvent, T previous, T next, String identifier) -
Method Summary
Modifier and TypeMethodDescriptionThe affected entityThe new valueThe old valueThe field name for the updated propertytoString()Methods inherited from class net.dv8tion.jda.api.events.guild.scheduledevent.GenericScheduledEventGatewayEvent
getScheduledEventMethods inherited from class net.dv8tion.jda.api.events.guild.GenericGuildEvent
getGuildMethods inherited from class net.dv8tion.jda.api.events.Event
getJDA, getRawData, getResponseNumberMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.dv8tion.jda.api.events.GenericEvent
getJDA, getRawData, getResponseNumberMethods inherited from interface net.dv8tion.jda.api.events.UpdateEvent
getEntityType
-
Constructor Details
-
GenericScheduledEventUpdateEvent
-
-
Method Details
-
getEntity
Description copied from interface:UpdateEventThe affected entity- Specified by:
getEntityin interfaceUpdateEvent<ScheduledEvent,T> - Returns:
- The affected entity
-
getPropertyIdentifier
Description copied from interface:UpdateEventThe field name for the updated propertyExample
@Override public void onGenericRoleUpdate(GenericRoleUpdateEvent event) { switch (event.getPropertyIdentifier()) { case RoleUpdateColorEvent.IDENTIFIER: System.out.printf("Updated color for role: %s%n", event); break; case RoleUpdatePositionEvent.IDENTIFIER: RoleUpdatePositionEvent update = (RoleUpdatePositionEvent) event; System.out.printf("Updated position for role: %s raw(%s->%s)%n", event, update.getOldPositionRaw(), update.getNewPositionRaw()); break; default: return; } }- Specified by:
getPropertyIdentifierin interfaceUpdateEvent<ScheduledEvent,T> - Returns:
- The name of the updated property
-
getOldValue
Description copied from interface:UpdateEventThe old value- Specified by:
getOldValuein interfaceUpdateEvent<ScheduledEvent,T> - Returns:
- The old value
-
getNewValue
Description copied from interface:UpdateEventThe new value- Specified by:
getNewValuein interfaceUpdateEvent<ScheduledEvent,T> - Returns:
- The new value
-
toString
-