JDA
JDA copied to clipboard
Add method to retrieve a list of scheduled events
General Troubleshooting
- [X] I have checked for similar issues on the Issue-tracker.
- [X] I have updated to the latest JDA version
- [X] I have checked the branches or the maintainers' PRs for upcoming features.
Feature Request
Provide a method that gets a list of scheduled events in a guild.
Currently it's possible to only fetch scheduled events by their id.
The Route
for this api call does exist, but is seemingly never actually used: https://github.com/discord-jda/JDA/blob/6ae83e3b6c4ac4b01fb80e1b1d8c5d982edeca48/src/main/java/net/dv8tion/jda/api/requests/Route.java#L139
The discord api documentation for this can be found here: https://github.com/discord/discord-api-docs/blob/main/docs/resources/Guild_Scheduled_Event.md#list-scheduled-events-for-guild--get-guildsguildiddocs_resources_guildguild-objectscheduled-events
Example Use-Case
public void foobar() {
Guild guild = // ...
List<ScheduledEvent> events = guild.retrieveScheduledEvents().complete();
if (events.isEmpty()) {
// Do something
return;
}
for (ScheduledEvent event : events) {
// Do something else
}
}