twilight_model/user/primary_guild.rs
1use crate::id::Id;
2use crate::id::marker::GuildMarker;
3use crate::util::ImageHash;
4use serde::{Deserialize, Serialize};
5
6/// The Primary Guild data (also known as guild tag(s)) provided with the [`User`] object.
7///
8/// A primary guild tag has a 2-4 length text content and a badge, in Discord laid out as \[BADGE]\[TAG].
9///
10/// [`User`]: twilight_model::user::User
11#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
12pub struct PrimaryGuild {
13 /// The id of the user's primary guild.
14 pub identity_guild_id: Option<Id<GuildMarker>>,
15 /// Whether the user is displaying their primary guild's server tag.
16 ///
17 /// Is `None` if the tag was non-manually cleared by the user. (e.g. user left server, server stopped supporting guild tags)
18 pub identity_enabled: Option<bool>,
19 /// The text content of the guild tag, within 2-4 characters.
20 pub tag: Option<String>,
21 /// The guild tag's badge hash.
22 pub badge: Option<ImageHash>,
23}