A user's primary guild — the "server tag" shown next to their name.
Optional and nullable on the user object: the key is present for every user, but
is nil unless they display a tag. Observed on a real guild (2026-09-19): 160 of
574 cached users had a non-nil value.
identity_enabled is deliberately tri-state — true when the tag is shown,
false when the user removed it manually, and nil when Discord cleared the
identity itself.
Example
%EDA.User.PrimaryGuild{
identity_guild_id: "1508992262657409046",
identity_enabled: true,
tag: "BABL",
badge: "22957f5661c149eefe1ba25d2bec7060"
}
Summary
Functions
URL of the server tag badge, or nil when there is none.
Returns true only when the user is actually displaying a server tag.
Parses the raw primary_guild object. Returns nil when absent or null.
Types
Functions
URL of the server tag badge, or nil when there is none.
Options
:size— power of two between 16 and 4096
Examples
iex> EDA.User.PrimaryGuild.badge_url(%EDA.User.PrimaryGuild{identity_guild_id: "1", badge: "abc"})
"https://cdn.discordapp.com/guild-tag-badges/1/abc.png"
Returns true only when the user is actually displaying a server tag.
Guards against the tri-state identity_enabled and against a tag being present
while disabled.
Examples
iex> EDA.User.PrimaryGuild.displayed?(%EDA.User.PrimaryGuild{identity_enabled: true, tag: "DISC"})
true
iex> EDA.User.PrimaryGuild.displayed?(%EDA.User.PrimaryGuild{identity_enabled: false, tag: "DISC"})
false
iex> EDA.User.PrimaryGuild.displayed?(nil)
false
Parses the raw primary_guild object. Returns nil when absent or null.