Skip to content

Commit 997c573

Browse files
committed
feat: add user collectibles
Ref: discord/discord-api-docs#7614
1 parent 79ae343 commit 997c573

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added:
9+
- Added `collectibles` to users
810
## [6.4.2] - 2025-06-15
911
### Fixed:
1012
- Fix express apps being forced to use `express.json` in the entire app ([#633](https://github.com/Snazzah/slash-create/pull/633))

src/constants.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ export interface CommandUser {
758758
username: string;
759759
avatar: string | null;
760760
avatar_decoration_data: AvatarDecorationData | null;
761+
collectibles: UserCollectibles | null;
761762
global_name: string | null;
762763
discriminator: string;
763764
public_flags: number;
@@ -768,6 +769,28 @@ export interface AvatarDecorationData {
768769
asset: string;
769770
}
770771

772+
export interface UserCollectibles {
773+
nameplate: UserNameplate | null;
774+
}
775+
776+
export interface UserNameplate {
777+
sku_id: string;
778+
asset: string;
779+
label: string;
780+
palette:
781+
| 'berry'
782+
| 'bubble_gum'
783+
| 'clover'
784+
| 'cobalt'
785+
| 'crimson'
786+
| 'forest'
787+
| 'lemon'
788+
| 'sky'
789+
| 'teal'
790+
| 'violet'
791+
| 'white';
792+
}
793+
771794
/** @private */
772795
export interface ResolvedRole {
773796
color: number;

src/structures/user.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ImageFormat,
66
ImageFormats,
77
ImageSizeBoundaries,
8+
UserCollectibles,
89
UserObject
910
} from '../constants';
1011
import { BaseSlashCreator } from '../creator';
@@ -24,6 +25,8 @@ export class User {
2425
readonly avatar?: string;
2526
/** The user's avatar decoration data. */
2627
readonly avatarDecorationData?: AvatarDecorationData;
28+
/** The user's collectibles. */
29+
readonly collectibles?: UserCollectibles | null;
2730
/** Whether the user is a bot. */
2831
readonly bot: boolean;
2932

@@ -46,6 +49,7 @@ export class User {
4649
this.globalName = data.global_name;
4750
if (data.avatar) this.avatar = data.avatar;
4851
if (data.avatar_decoration_data) this.avatarDecorationData = data.avatar_decoration_data;
52+
if (data.collectibles) this.collectibles = data.collectibles;
4953
this._flags = data.public_flags;
5054
this.bot = data.bot || false;
5155
}

0 commit comments

Comments
 (0)