|
1 | 1 | import type { OAuthConfig, OAuthUserConfig } from "./index.js"
|
2 | 2 |
|
| 3 | +/** |
| 4 | + * Corresponds to the user structure documented here: |
| 5 | + * https://discord.com/developers/docs/resources/user#user-object-user-structure |
| 6 | + */ |
3 | 7 | export interface DiscordProfile extends Record<string, any> {
|
4 |
| - accent_color: number |
5 |
| - avatar: string |
6 |
| - banner: string |
7 |
| - banner_color: string |
8 |
| - discriminator: string |
9 |
| - email: string |
10 |
| - flags: number |
| 8 | + /** the user's id (i.e. the numerical snowflake) */ |
11 | 9 | id: string
|
12 |
| - image_url: string |
13 |
| - locale: string |
| 10 | + /** the user's username, not unique across the platform */ |
| 11 | + username: string |
| 12 | + /** the user's 4-digit discord-tag */ |
| 13 | + discriminator: string |
| 14 | + /** |
| 15 | + * the user's avatar hash: |
| 16 | + * https://discord.com/developers/docs/reference#image-formatting |
| 17 | + */ |
| 18 | + avatar: string | null |
| 19 | + /** whether the user belongs to an OAuth2 application */ |
| 20 | + bot?: boolean |
| 21 | + /** |
| 22 | + * whether the user is an Official Discord System user (part of the urgent |
| 23 | + * message system) |
| 24 | + */ |
| 25 | + system?: boolean |
| 26 | + /** whether the user has two factor enabled on their account */ |
14 | 27 | mfa_enabled: boolean
|
| 28 | + /** |
| 29 | + * the user's banner hash: |
| 30 | + * https://discord.com/developers/docs/reference#image-formatting |
| 31 | + */ |
| 32 | + banner: string | null |
| 33 | + |
| 34 | + /** the user's banner color encoded as an integer representation of hexadecimal color code */ |
| 35 | + accent_color: number | null |
| 36 | + |
| 37 | + /** |
| 38 | + * the user's chosen language option: |
| 39 | + * https://discord.com/developers/docs/reference#locales |
| 40 | + */ |
| 41 | + locale: string |
| 42 | + /** whether the email on this account has been verified */ |
| 43 | + verified: boolean |
| 44 | + /** the user's email */ |
| 45 | + email: string | null |
| 46 | + /** |
| 47 | + * the flags on a user's account: |
| 48 | + * https://discord.com/developers/docs/resources/user#user-object-user-flags |
| 49 | + */ |
| 50 | + flags: number |
| 51 | + /** |
| 52 | + * the type of Nitro subscription on a user's account: |
| 53 | + * https://discord.com/developers/docs/resources/user#user-object-premium-types |
| 54 | + */ |
15 | 55 | premium_type: number
|
| 56 | + /** |
| 57 | + * the public flags on a user's account: |
| 58 | + * https://discord.com/developers/docs/resources/user#user-object-user-flags |
| 59 | + */ |
16 | 60 | public_flags: number
|
17 |
| - username: string |
18 |
| - verified: boolean |
| 61 | + /** undocumented field; corresponds to the user's custom nickname */ |
| 62 | + display_name: string | null |
| 63 | + /** |
| 64 | + * undocumented field; corresponds to the Discord feature where you can e.g. |
| 65 | + * put your avatar inside of an ice cube |
| 66 | + */ |
| 67 | + avatar_decoration: string | null |
| 68 | + /** |
| 69 | + * undocumented field; corresponds to the premium feature where you can |
| 70 | + * select a custom banner color |
| 71 | + */ |
| 72 | + banner_color: string | null |
| 73 | + /** undocumented field; the CDN URL of their profile picture */ |
| 74 | + image_url: string |
19 | 75 | }
|
20 | 76 |
|
21 | 77 | export default function Discord<P extends DiscordProfile>(
|
|
0 commit comments