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 support for guild scheduled events v2 #2047

Merged
merged 156 commits into from
Oct 23, 2022

Conversation

Mitmocc
Copy link
Contributor

@Mitmocc Mitmocc commented Feb 26, 2022

  • I have checked the PRs for upcoming features/bug fixes.
  • I have read the [contributing guidelines][contributing].

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: _____

Description

This PR adds support for Guild Scheduled Events.
This PR is based on a previous PR #1905 by @Yashar256.
The previous PR is a few versions behind and only outlined the general structure of the implementation.
It was quite far away from a working implementation. It did however have the documentation done for the most part.
I was advised to make it a separate PR, if this is an issue please let me know / delete this PR.

Creating a Guild Scheduled Event:

        guild.createScheduledEvent("Monday Meeting", voiceChannel, OffsetDateTime.now().plusHours(1)).queue();

Known issues:

  • When a guild object is created and an existing event is tied to a voice or stage channel thats not viewable by the bot, the guild scheduled event is not sent with the guild payload. When the permissions on the voice or stage channel change, the guild scheduled event won't be cached regardless (until it is retrieved or the guild scheduled event is edited). I'm not sure if there is anything we can do against that, but I'm writing it down here anyway. In my opinion, this is discords issue to resolve as the guild scheduled event should have been sent in the guild payload regardless of wether the channel was viewable for the bot. Same behaviour we have with channels.
  • The channel permission "Manage Events" is not working at all, this is a discord issue. (Was resolved a while ago)

I apologize in advance for any beginner mistakes, this is my first time working on JDA internals.

Revert "revert prints used for testing"

This reverts commit a9cc5cb.

Revert "test"

This reverts commit d9a076c.

Update GuildScheduledEventUpdateHandler.java
Update GuildScheduledEventUpdateHandler.java

test

Update GuildScheduledEventUserAddHandler.java
src/main/java/net/dv8tion/jda/api/JDA.java Outdated Show resolved Hide resolved
src/main/java/net/dv8tion/jda/api/JDA.java Outdated Show resolved Hide resolved
src/main/java/net/dv8tion/jda/api/JDA.java Outdated Show resolved Hide resolved
src/main/java/net/dv8tion/jda/api/JDA.java Outdated Show resolved Hide resolved
src/main/java/net/dv8tion/jda/api/JDA.java Outdated Show resolved Hide resolved
Mitmocc and others added 3 commits February 26, 2022 11:43
minor formatting fixes

Co-authored-by: Marcel Korzonek <68189302+Xirado@users.noreply.github.com>
@Mitmocc Mitmocc marked this pull request as ready for review February 27, 2022 09:04
…eduledEvent to ScheduledEvent, small improvements from minns suggestions
…dler.java

Co-authored-by: Florian Spieß <business@minn.dev>
v5 automation moved this from Review in progress to Reviewer approved Oct 23, 2022
@MinnDevelopment MinnDevelopment merged commit daf17d1 into discord-jda:master Oct 23, 2022
v5 automation moved this from Reviewer approved to Done Oct 23, 2022
@Mitmocc Mitmocc deleted the v5-guild_scheduled_events branch December 7, 2022 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
v5
Done
Development

Successfully merging this pull request may close these issues.

None yet

9 participants