1"""Member link status, reported to the bot for role syncing."""
2
3from pydantic import BaseModel
4
5
[docs]
6class MemberLink(BaseModel):
7 """One known member's link status (``GET /api/guilds/{guild_id}/member-links``), bot-facing.
8
9 ``discord_id`` is an ``int`` here (unlike the public ``Me`` schema, which carries it as a string): this
10 route is bot-key only and the bot already works with Discord ids as integers.
11
12 ``signed_in`` is false for a member a Quest Master confirmed from Discord who has never signed in on the site.
13 """
14
15 discord_id: int
16 battlenet_linked: bool
17 # Defaulted so a bot newer than the API still parses (same reasoning as GuildConfigSchema's role ids).
18 roster_confirmed: bool = False
19 signed_in: bool = True
20 # In-game guild rank names held by the member's characters on the Battle.net guild roster, best rank first
21 # (several when their characters hold different ranks). ``guild_ranks`` counts every character linked to them;
22 # ``battlenet_guild_ranks`` only those their linked Battle.net account owns. Empty when none is on the roster.
23 guild_ranks: list[str] = []
24 battlenet_guild_ranks: list[str] = []
25 # Their characters on the Battle.net guild roster ("Name Surname"), the one that joined the guild first leading.
26 guild_characters: list[str] = []
27 # Whether the bot has made its one nickname call (set it to guild_characters[0], or left an existing one). True
28 # by default, so a bot newer than the API never renames anyone.
29 character_nick_done: bool = True