Skip to content

Add role parameters to support new gradient and holographic roles #10214

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

Merged
merged 17 commits into from
Jul 8, 2025

Conversation

makerze
Copy link
Contributor

@makerze makerze commented Jun 21, 2025

Summary

Add new role parameters primary_color, secondary_color and tertiary_color to support new gradient and holographic roles

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@DA-344
Copy link
Contributor

DA-344 commented Jun 21, 2025

makerze and others added 2 commits June 21, 2025 13:29
Copy link
Contributor

@DA-344 DA-344 left a comment

Choose a reason for hiding this comment

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

Please, update the corresponding types/ object, and make sure you follow the documentation (pr): discord/discord-api-docs#7549 : only time when colors is not required is when creating a role, but it is still recommended to be passed

makerze and others added 4 commits June 23, 2025 01:05
Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com>
Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com>
Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com>
Copy link
Contributor

@DA-344 DA-344 left a comment

Choose a reason for hiding this comment

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

Again, please refer to the discord api docs PR I referred on my last review, these are incorrect.

discord/role.py Outdated
Comment on lines 556 to 558
colours = {
'primary_color': payload['color'],
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should change this to not pass the color key on the payload at all, because it is not recommended anymore, use the colors field everytime, even if not using a gradient/holographic colour.

discord/guild.py Outdated
Comment on lines 3757 to 3758
else:
fields['color'] = actual_colour.value
Copy link
Contributor

Choose a reason for hiding this comment

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

This and the lines above should just be on colors.primary_color, not on color anymore.

Copy link
Owner

@Rapptz Rapptz left a comment

Choose a reason for hiding this comment

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

This looks fine, just needs the appropriate .. versionadded:: 2.6 strings.

@Rapptz
Copy link
Owner

Rapptz commented Jul 3, 2025

Apparently Role.color is now deprecated so you need to get it from Role.colors.primary_color instead. I'm not sure whether it's necessary to do now, but Role.colour should be a property for that and the update route should update primary_color instead.

Copy link
Contributor

@DA-344 DA-344 left a comment

Choose a reason for hiding this comment

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

LGTM as long as these are fixed!

Co-authored-by: DA344 <108473820+DA-344@users.noreply.github.com>
Copy link
Contributor

@DA-344 DA-344 left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
Copy link
Owner

@Rapptz Rapptz left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@Rapptz Rapptz merged commit cb73009 into Rapptz:master Jul 8, 2025
8 checks passed
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.

4 participants