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

refactor(embed): allow hex strings in setColor() #7593

Merged

Conversation

suneettipirneni
Copy link
Member

Please describe the changes this PR makes and why it should be merged:

Originally I had assumed hex number literals would suffice over hex strings. However, many external services may return colors as hex strings because it's a popular format. This PR allows hex strings to be passed into setColor for discord.js embed builders.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

Copy link
Contributor

@ImRodry ImRodry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW this doesn't only allow hex strings, it also allows Color strings e.g. "Blurple"

@suneettipirneni suneettipirneni force-pushed the discord.js/refactor/allow-string-colors branch from a210304 to b38e072 Compare March 4, 2022 00:12
@suneettipirneni suneettipirneni force-pushed the discord.js/refactor/allow-string-colors branch from b38e072 to 070a3b1 Compare March 4, 2022 03:09
@iCrawl iCrawl added this to the discord.js v14 milestone Mar 4, 2022
@suneettipirneni suneettipirneni force-pushed the discord.js/refactor/allow-string-colors branch from 070a3b1 to 000a693 Compare March 4, 2022 16:51
@iCrawl iCrawl merged commit 79d6c04 into discordjs:main Mar 6, 2022
@suneettipirneni suneettipirneni deleted the discord.js/refactor/allow-string-colors branch July 6, 2022 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants