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 check for max number of fields in EmbedBuilder #2592

Merged

Conversation

Andre601
Copy link
Contributor

Pull Request Etiquette

Changes

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

Closes Issue: NaN

Description

Discord changed their API in regards to embed fields. It will now return errors when you send JSON with more than 25 fields defined.
This PR adds two things:

  1. It adds a new MAX_FIELD_AMOUNT constant set to 25
  2. It adds a check in EmbedBuilder#build() for if the number is above the max allowed, at which point it throws an IllegalStateException

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

Successfully merging this pull request may close these issues.

None yet

2 participants