diff options
author | Puyodead1 <puyodead@proton.me> | 2023-05-19 16:45:02 -0400 |
---|---|---|
committer | Puyodead1 <puyodead@proton.me> | 2023-05-19 16:45:02 -0400 |
commit | de0715f659e72b28349fd5dd7e95bb0b6750552c (patch) | |
tree | de97c32092e1d08743755a0c4e5c9af4fd35280e /src | |
parent | Merge pull request #1054 from CyberL1/master (diff) | |
download | server-de0715f659e72b28349fd5dd7e95bb0b6750552c.tar.xz |
update some properties dev/update-user-fields
Diffstat (limited to 'src')
-rw-r--r-- | src/api/routes/users/#id/profile.ts | 14 | ||||
-rw-r--r-- | src/util/entities/User.ts | 8 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/api/routes/users/#id/profile.ts b/src/api/routes/users/#id/profile.ts index a94eb546..68627637 100644 --- a/src/api/routes/users/#id/profile.ts +++ b/src/api/routes/users/#id/profile.ts @@ -93,7 +93,9 @@ router.get( accent_color: user.accent_color, banner: user.banner, bio: req.user_bot ? null : user.bio, - bot: user.bot, + flags: user.flags, + avatar_decoration: user.avatar_decoration, + banner_color: user.banner_color, }; const userProfile = { @@ -102,6 +104,8 @@ router.get( banner: user.banner, pronouns: user.pronouns, theme_colors: user.theme_colors, + emoji: null, // TODO: + popout_animation_particle_type: null, // TODO: }; const guildMemberDto = guild_member @@ -113,8 +117,7 @@ router.get( guild_member.communication_disabled_until, deaf: guild_member.deaf, flags: user.flags, - is_pending: guild_member.pending, - pending: guild_member.pending, // why is this here twice, discord? + pending: guild_member.pending, joined_at: guild_member.joined_at, mute: guild_member.mute, nick: guild_member.nick, @@ -131,6 +134,9 @@ router.get( banner: guild_member?.banner || null, bio: guild_member?.bio || "", guild_id, + theme_colors: null, + emoji: null, // TODO: + popout_animation_particle_type: null, // TODO: }; res.json({ connected_accounts: user.connected_accounts.filter( @@ -145,6 +151,8 @@ router.get( user_profile: userProfile, guild_member: guild_id && guildMemberDto, guild_member_profile: guild_id && guildMemberProfile, + guild_badges: [], // TODO: + badges: [], // TODO: }); }, ); diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index 3e72c3c9..21e01403 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -48,8 +48,10 @@ export enum PublicUserEnum { id, public_flags, avatar, + avatar_decoration, accent_color, banner, + banner_color, bio, bot, premium_since, @@ -104,11 +106,17 @@ export class User extends BaseClass { avatar?: string; // hash of the user avatar @Column({ nullable: true }) + avatar_decoration?: string; // hash of the users avatar decoration + + @Column({ nullable: true }) accent_color?: number; // banner color of user @Column({ nullable: true }) banner?: string; // hash of the user banner + @Column({ nullable: true }) + banner_color?: number; // the real banner color of the user? lol + // TODO: Separate `User` and `UserProfile` models // puyo: changed from [number, number] because it breaks openapi @Column({ nullable: true, type: "simple-array" }) |