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

Fix ScheduledEventManagerImpl::setStatus #2743

Merged

Conversation

raul1ro
Copy link
Contributor

@raul1ro raul1ro commented Sep 30, 2024

Pull Request Etiquette

Changes

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

Closes Issue: NaN

Description

The check status != ScheduledEvent.Status.SCHEDULED && getScheduledEvent().getStatus() != ScheduledEvent.Status.ACTIVE is not correct.
According to Discord documentation you can set ACTIVE to COMPLETED, but if the event was ACTIVE, the check was always false and throwing error.

New checks:

  • Current status should be different than COMPLETED or CANCELED
  • If current status is SCHEDULED, the new one can be only ACTIVE or CANCELED
  • If current status is ACTIVE, the new one can be only COMPLETED

I also updated the first check which verifies the new status to not be UNKNOWN.
I added the condition that the new status to not be SCHEDULED too.

@MinnDevelopment MinnDevelopment merged commit e1188e7 into discord-jda:master Oct 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants