Skip to content

Add ability to use primary guild (clan) data for users #10211

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 38 commits into from
Jul 18, 2025

Conversation

blord0
Copy link
Contributor

@blord0 blord0 commented Jun 18, 2025

Summary

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, ...)

@Soheab
Copy link
Contributor

Soheab commented Jun 18, 2025

There is already a PR for this: #10190
even though this implementation looks majorly better

Copy link
Contributor

@dolfies dolfies left a comment

Choose a reason for hiding this comment

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

the clan field is deprecated, this should use primary_guild (and the naming should prolly reflect that as clans are a dead concept)

@blord0 blord0 changed the title Add ability to use clan data for users Add ability to use primary guild (clan) data for users Jun 18, 2025
@blord0
Copy link
Contributor Author

blord0 commented Jun 19, 2025

Looks nice, but still needs to wait for discord to document this

Any idea how often discord updates their documentation? Latest pull in discord's api docs for tags was opened 2nd May 2024 and has not been updated in the past 3 weeks discord/discord-api-docs#6836

@blord0
Copy link
Contributor Author

blord0 commented Jun 19, 2025

Also the api does seem to be stable. From discord/discord-api-docs#6836 (comment) (19th May 2024) you can see that they still use the same fields of tag, identity_guild_id, identity_enabled and badge. Only part that has changed is it is now under the primary_guild section, not clan

@DA-344
Copy link
Contributor

DA-344 commented Jun 20, 2025

You'll need to wait for Discord to just merge the documentation of it, and although it looks stable doesn't mean it will always be, rn is not documented so they have an excuse to (although even documented they do) break the field at any point.

@Rapptz Rapptz mentioned this pull request Jun 20, 2025
6 tasks
@blord0
Copy link
Contributor Author

blord0 commented Jun 20, 2025

You'll need to wait for Discord to just merge the documentation of it, and although it looks stable doesn't mean it will always be, rn is not documented so they have an excuse to (although even documented they do) break the field at any point.

Yea I get that, but tags have been rolled out to all servers now. The one change discord did was the field name from clan -> primary_guild due to clans being deprecated (I would argue that this is an even stronger indication that they won't change as the fields of tag, identity_guild_id, identity_enabled and badge are all the same even after a renaming, as that would have been the perfect point to re-do anything they wanted to do)

+In the unlikely event they do, I would be more than happy to fix/patch/whatever the code

@DA-344
Copy link
Contributor

DA-344 commented Jun 20, 2025

Still, docs must be merged first

@Rapptz
Copy link
Owner

Rapptz commented Jun 20, 2025

Generally speaking I don't merge features that are undocumented because we've been bitten by it in the past (most recently, voice channel statuses) and it's not worth the upkeep.

@Rapptz Rapptz added the pending PR implements an in-progress or explicitly unreleased Discord feature label Jun 20, 2025
@Soheab
Copy link
Contributor

Soheab commented Jul 1, 2025

The API docs have been merged per discord/discord-api-docs@a1bac5f !

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.

The route has changed

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

blord0 commented Jul 3, 2025

Just double checked the docs and everything seems good to me
https://discord.com/developers/docs/resources/user#user-object-user-primary-guild

Copy link
Contributor

@Soheab Soheab left a comment

Choose a reason for hiding this comment

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

LGMT overall.

Comment on lines 91 to 92
payload: PrimaryGuildPayload = {"identity_guild_id": None, "identity_enabled": False, "tag": None, "badge": None}
return cls(state=state, data=payload)
Copy link
Contributor

@Soheab Soheab Jul 5, 2025

Choose a reason for hiding this comment

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

You don't really need to define each key here; an empty dict would work too since the _update method makes everything default to None regardless.

I guess it's better to be explicit, but I’m not sure.

Copy link
Owner

Choose a reason for hiding this comment

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

I agree here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it to set only identity_enabled to False, as None has a specific meaning

Comment on lines 91 to 92
payload: PrimaryGuildPayload = {"identity_guild_id": None, "identity_enabled": False, "tag": None, "badge": None}
return cls(state=state, data=payload)
Copy link
Owner

Choose a reason for hiding this comment

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

I agree here.

@Rapptz Rapptz removed the pending PR implements an in-progress or explicitly unreleased Discord feature label Jul 8, 2025
@blord0
Copy link
Contributor Author

blord0 commented Jul 11, 2025

Sorry for delays, was on holiday

@blord0 blord0 requested a review from Rapptz July 12, 2025 11:06
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 7724764 into Rapptz:master Jul 18, 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.

5 participants