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

Add method to retrieve a list of scheduled events #2700

Open
3 tasks done
senseiwells opened this issue Jul 5, 2024 · 0 comments
Open
3 tasks done

Add method to retrieve a list of scheduled events #2700

senseiwells opened this issue Jul 5, 2024 · 0 comments
Labels
status: in progress already in the process of being implemented type: feature

Comments

@senseiwells
Copy link

senseiwells commented Jul 5, 2024

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
    }
}
@MinnDevelopment MinnDevelopment added status: in progress already in the process of being implemented type: feature labels Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in progress already in the process of being implemented type: feature
Projects
None yet
Development

No branches or pull requests

2 participants