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 role icon properties to ResolvedRole #147

Merged
merged 3 commits into from
Oct 2, 2021

Conversation

sudojunior
Copy link
Contributor

@sudojunior sudojunior commented Oct 2, 2021

Added

  • Role#icon as a nullable string which is an image hash if available including icons as uploaded from custom emojis.
  • Role#unicode_emoji as a nullable string which is... a unicode emoji.
  • get Role#iconURL -> Role#dynamicIconURL()
  • Role#dynamicIconURL(format?, size?) which returns as null if #icon doesn't exist.
  • ROLE_ICON(format, size) cdn route to Endpoints

Role#icon and Role#unicode_emoji are reflected from ResolvedRole as it's sibling type definition.

@sudojunior sudojunior requested a review from Snazzah as a code owner October 2, 2021 20:13
@Snazzah
Copy link
Owner

Snazzah commented Oct 2, 2021

These new properties should be exposed in the Role class, along with a roleIconURL and dynamidRoleIconURL method similar to the User class.

@Snazzah Snazzah added semver: minor PRs that contain new features and will be on the next minor release type: enhancement New feature or request labels Oct 2, 2021
* creator instance was required to get image defaults for format and size
@sudojunior
Copy link
Contributor Author

It should be noted that the new dynamicIconURL method will accept gif as an argument for format, but the CDN will not have that format. I could probably go back in and exclude it from ImageFormat, but then the code logic would also need another change to fallback to a default.

@Snazzah Snazzah merged commit 269b3ca into Snazzah:master Oct 2, 2021
@sudojunior sudojunior deleted the feature/role-icons branch October 2, 2021 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor PRs that contain new features and will be on the next minor release type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants