1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-24 19:32:46 +01:00

update some properties

This commit is contained in:
Puyodead1 2023-05-19 16:45:02 -04:00
parent 60394d8c43
commit de0715f659
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
4 changed files with 1579 additions and 3 deletions

View File

@ -1357,12 +1357,18 @@
"avatar": {
"type": "string"
},
"avatar_decoration": {
"type": "string"
},
"accent_color": {
"type": "integer"
},
"banner": {
"type": "string"
},
"banner_color": {
"type": "integer"
},
"theme_colors": {
"type": "array",
"items": {
@ -3478,12 +3484,18 @@
"avatar": {
"type": "string"
},
"avatar_decoration": {
"type": "string"
},
"accent_color": {
"type": "integer"
},
"banner": {
"type": "string"
},
"banner_color": {
"type": "integer"
},
"bio": {
"type": "string"
},
@ -6930,12 +6942,18 @@
"avatar": {
"type": "string"
},
"avatar_decoration": {
"type": "string"
},
"accent_color": {
"type": "integer"
},
"banner": {
"type": "string"
},
"banner_color": {
"type": "integer"
},
"bio": {
"type": "string"
},
@ -7047,12 +7065,18 @@
"avatar": {
"type": "string"
},
"avatar_decoration": {
"type": "string"
},
"accent_color": {
"type": "integer"
},
"banner": {
"type": "string"
},
"banner_color": {
"type": "integer"
},
"bio": {
"type": "string"
},

File diff suppressed because it is too large Load Diff

View File

@ -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:
});
},
);

View File

@ -48,8 +48,10 @@ export enum PublicUserEnum {
id,
public_flags,
avatar,
avatar_decoration,
accent_color,
banner,
banner_color,
bio,
bot,
premium_since,
@ -103,12 +105,18 @@ export class User extends BaseClass {
@Column({ nullable: true })
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" })