Skip to content

Conversation

xDec0de
Copy link

@xDec0de xDec0de commented Apr 23, 2025

Pull Request Etiquette

Changes

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

Closes Issue: NaN

Description

Just a simple change to avoid using a regex Pattern when checking if a URL is valid on the EmbedBuilder class. Instead, it relies on String#regionMatches (Case insensitive) and a simple length check to have the exact same behaviour as the current pattern. I know this may be considered micro optimization, but I found it and thought it could be an easy first PR for me.

@xDec0de
Copy link
Author

xDec0de commented Apr 23, 2025

Oh, I forgot to mention that I was going to deprecate EmbedBuilder#URL_PATTERN in favor of EmbedBuilder#isUrlOrAttachment, but I decided not to and leave that decision to the maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant