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 user accent_color and banner fields #1127

Merged
merged 3 commits into from
Sep 17, 2021
Merged

Add user accent_color and banner fields #1127

merged 3 commits into from
Sep 17, 2021

Conversation

zeylahellyer
Copy link
Member

@zeylahellyer zeylahellyer commented Aug 23, 2021

Add the new accent_color and banner fields. accent_color is an integer representation of the RGB color while banner is a hash of the user's banner image. These are mutually exclusive.

This is documented in the API docs: discord/discord-api-docs#3448

Closes #1126.

@zeylahellyer zeylahellyer added t-feature Addition of a new feature c-cache Affects the cache crate c-model Affects the model crate d-api Change related to Discord's API. c-standby Affects the standby crate labels Aug 23, 2021
Add the new `accent_color` and `banner` fields. `accent_color` is an
integer representation of the RGB color while `banner` is a hash of the
user's banner image. These are mutually exclusive.

This is documented in the API docs:
<discord/discord-api-docs#3448>

Closes #1126.

Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
@BlackHoleFox
Copy link
Member

If these are mutually exclusive, is it too far out for Twilight to make an enum represententing them as such instead of two options, which technically could allow for illegal states?

7596ff
7596ff previously approved these changes Aug 25, 2021
7596ff
7596ff previously approved these changes Sep 8, 2021
AsianIntel
AsianIntel previously approved these changes Sep 9, 2021
@zeylahellyer zeylahellyer marked this pull request as draft September 9, 2021 17:59
Signed-off-by: Zeyla Hellyer <zeyla@hellyer.dev>
@zeylahellyer zeylahellyer dismissed stale reviews from AsianIntel and 7596ff via 4b84280 September 10, 2021 21:10
@zeylahellyer zeylahellyer marked this pull request as ready for review September 10, 2021 21:10
@zeylahellyer
Copy link
Member Author

If these are mutually exclusive, is it too far out for Twilight to make an enum represententing them as such instead of two options, which technically could allow for illegal states?

I was wrong and they aren't exclusive:

{
  "id": "640434332485287936",
  "username": "zeyla",
  "avatar": "a262fa99ab1d42f16751c67886da5640",
  "discriminator": "4443",
  "public_flags": 0,
  "banner": "ce98ed5651d0add1e3ff98782095a7dd",
  "banner_color": "#17191c",
  "accent_color": 1513756
}

Copy link
Member

@Erk- Erk- left a comment

Choose a reason for hiding this comment

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

Should we model the difference between null and the value being omitted here? Or is the difference irrelevant in all cases?

@7596ff 7596ff merged commit 5948f81 into twilight-rs:main Sep 17, 2021
7596ff added a commit that referenced this pull request Sep 17, 2021
Additions

Add `Command::kind`, which is a `CommandType`, in order to support
Message and User application commands ([#1107] - [@7596ff]).

Add `CommandInteractionDataResolved::messages`, which is a list of
messages relevant to the interaction ([#1107] - [@7596ff]).

Add `MessageType::ContextMenuCommand`, which is relevant to Message and
User commands ([#1107] - [@7596ff]).

Add the `{Current, User}::{accent_color, banner}` fields ([#1127] -
[@zeylahellyer]).

Fixes

`Command` deserialization no longer errors if the `options` field was
missing ([#1112] - [@Erk-]).

[#1107]: #1107

[@7596ff]: https://github.com/7596ff
[@zeylahellyer]: https://github.com/zeylahellyer
@zeylahellyer zeylahellyer deleted the feat/model/user-accent-color-and-banner branch September 18, 2021 01:47
MaxOhn pushed a commit to MaxOhn/twilight that referenced this pull request Oct 7, 2021
Add the new `accent_color` and `banner` fields. `accent_color` is an
integer representation of the RGB color while `banner` is a hash of the
user's banner image.

This is documented in the API docs:
<discord/discord-api-docs#3448>

Closes twilight-rs#1126.
MaxOhn pushed a commit to MaxOhn/twilight that referenced this pull request Oct 7, 2021
Additions

Add `Command::kind`, which is a `CommandType`, in order to support
Message and User application commands ([twilight-rs#1107] - [@7596ff]).

Add `CommandInteractionDataResolved::messages`, which is a list of
messages relevant to the interaction ([twilight-rs#1107] - [@7596ff]).

Add `MessageType::ContextMenuCommand`, which is relevant to Message and
User commands ([twilight-rs#1107] - [@7596ff]).

Add the `{Current, User}::{accent_color, banner}` fields ([twilight-rs#1127] -
[@zeylahellyer]).

Fixes

`Command` deserialization no longer errors if the `options` field was
missing ([twilight-rs#1112] - [@Erk-]).

[twilight-rs#1107]: twilight-rs#1107

[@7596ff]: https://github.com/7596ff
[@zeylahellyer]: https://github.com/zeylahellyer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-cache Affects the cache crate c-model Affects the model crate c-standby Affects the standby crate d-api Change related to Discord's API. t-feature Addition of a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add user accent color and banner fields
5 participants