discord-jda/JDA

Add method to retrieve a list of scheduled events

senseiwells opened this issue · 0 comments

General Troubleshooting

  • I have checked for similar issues on the Issue-tracker.
  • I have updated to the latest JDA version
  • 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:

public static final Route GET_SCHEDULED_EVENTS = new Route(GET, "guilds/{guild_id}/scheduled-events");

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
    }
}