/** * Types extracted from https://docs.discord.com/developers/resources/application-identity-profile */ import type { Snowflake } from '../../globals'; /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#application-identity-object} */ export interface APIApplicationIdentity { /** * The external account provider type */ provider_type: string; /** * Provider-specific identifier used to disambiguate identities * * @remarks This field is omitted when it is absent or empty. */ provider_id?: string; /** * The user's ID in the external system */ provider_issued_user_id: string; } /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#get-application-identities-by-user-id} */ export interface APIUserApplicationIdentity extends APIApplicationIdentity { /** * The Discord user ID */ user_id: Snowflake; } /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#application-identity-profile-object} */ export interface APIApplicationIdentityProfile { /** * The user's username in the external system */ username: string | null; /** * Arbitrary game-defined data, not consumed by Discord, stored for the application's own use */ metadata: Record | null; /** * The profile data containing game stats */ data: APIApplicationIdentityProfileData | null; } /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#profile-data-object} */ export interface APIApplicationIdentityProfileData { /** * Pre-configured game stat fields */ primary?: APIApplicationIdentityProfilePrimaryData; /** * Custom game stat fields */ dynamic?: APIApplicationIdentityProfileDynamicField[]; } /** * Pre-configured fields meant to be generic across many games * * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#primary-profile-data-object} */ export interface APIApplicationIdentityProfilePrimaryData { /** * Current season name (e.g. `Season 3`) */ season?: string; /** * Current rank name (e.g. `Silver`) */ rank_name?: string; /** * Image representing the current rank */ rank_image?: APIApplicationIdentityProfileMedia; /** * Highest rank achieved */ highest_rank?: string; /** * Image representing the highest rank achieved */ highest_rank_image?: APIApplicationIdentityProfileMedia; /** * Name of the featured played character */ featured_played_character?: string; /** * Image of the featured played character */ featured_played_character_image?: APIApplicationIdentityProfileMedia; /** * Total playtime in hours, accepts decimal values (e.g. `69.41`) */ playtime_hours?: number; /** * Total number of wins */ total_wins?: number; /** * Wins in the current period (e.g. season) */ current_period_wins?: number; /** * Total number of games played */ total_games?: number; /** * Games played in the current period */ current_period_games?: number; /** * Total number of kills */ total_kills?: number; /** * Kills in the current period */ current_period_kills?: number; /** * Total number of assists */ total_assists?: number; /** * Assists in the current period */ current_period_assists?: number; /** * Total number of deaths */ total_deaths?: number; /** * Deaths in the current period */ current_period_deaths?: number; } /** * Dynamic fields let you specify custom stats when the pre-configured primary fields don't cover your needs * * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#dynamic-field-object} */ export interface APIBaseApplicationIdentityProfileDynamicField { /** * The type of the dynamic field, which determines its value format */ type: Type; /** * The field name * * @remarks This is the data key referenced in the widget editor when configuring a User Data field, it is not shown to players. */ name: string; /** * The value of the dynamic field */ value: Value; } /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#dynamic-field-object-dynamic-field-types} */ export declare enum ApplicationIdentityProfileDynamicFieldType { /** * A text value */ String = 1, /** * A numeric value */ Number = 2, /** * A media object (image URL) */ Media = 3 } /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#dynamic-field-object-dynamic-string-field-structure} */ export type APIApplicationIdentityProfileStringDynamicField = APIBaseApplicationIdentityProfileDynamicField; /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#dynamic-field-object-dynamic-number-field-structure} */ export type APIApplicationIdentityProfileNumberDynamicField = APIBaseApplicationIdentityProfileDynamicField; /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#dynamic-field-object-dynamic-media-field-structure} */ export type APIApplicationIdentityProfileMediaDynamicField = APIBaseApplicationIdentityProfileDynamicField; /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#dynamic-field-object} */ export type APIApplicationIdentityProfileDynamicField = APIApplicationIdentityProfileMediaDynamicField | APIApplicationIdentityProfileNumberDynamicField | APIApplicationIdentityProfileStringDynamicField; /** * @see {@link https://docs.discord.com/developers/resources/application-identity-profile#media-object} */ export interface APIApplicationIdentityProfileMedia { /** * URL of the media asset * * @remarks The url must be reachable from the public internet, Discord's media unfurler fetches it from Discord's servers and not from the user's client, so localhost or LAN-only urls will not load. */ url: string; } //# sourceMappingURL=applicationIdentityProfile.d.ts.map