1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-22 02:12:40 +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": { "avatar": {
"type": "string" "type": "string"
}, },
"avatar_decoration": {
"type": "string"
},
"accent_color": { "accent_color": {
"type": "integer" "type": "integer"
}, },
"banner": { "banner": {
"type": "string" "type": "string"
}, },
"banner_color": {
"type": "integer"
},
"theme_colors": { "theme_colors": {
"type": "array", "type": "array",
"items": { "items": {
@ -3478,12 +3484,18 @@
"avatar": { "avatar": {
"type": "string" "type": "string"
}, },
"avatar_decoration": {
"type": "string"
},
"accent_color": { "accent_color": {
"type": "integer" "type": "integer"
}, },
"banner": { "banner": {
"type": "string" "type": "string"
}, },
"banner_color": {
"type": "integer"
},
"bio": { "bio": {
"type": "string" "type": "string"
}, },
@ -6930,12 +6942,18 @@
"avatar": { "avatar": {
"type": "string" "type": "string"
}, },
"avatar_decoration": {
"type": "string"
},
"accent_color": { "accent_color": {
"type": "integer" "type": "integer"
}, },
"banner": { "banner": {
"type": "string" "type": "string"
}, },
"banner_color": {
"type": "integer"
},
"bio": { "bio": {
"type": "string" "type": "string"
}, },
@ -7047,12 +7065,18 @@
"avatar": { "avatar": {
"type": "string" "type": "string"
}, },
"avatar_decoration": {
"type": "string"
},
"accent_color": { "accent_color": {
"type": "integer" "type": "integer"
}, },
"banner": { "banner": {
"type": "string" "type": "string"
}, },
"banner_color": {
"type": "integer"
},
"bio": { "bio": {
"type": "string" "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, accent_color: user.accent_color,
banner: user.banner, banner: user.banner,
bio: req.user_bot ? null : user.bio, 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 = { const userProfile = {
@ -102,6 +104,8 @@ router.get(
banner: user.banner, banner: user.banner,
pronouns: user.pronouns, pronouns: user.pronouns,
theme_colors: user.theme_colors, theme_colors: user.theme_colors,
emoji: null, // TODO:
popout_animation_particle_type: null, // TODO:
}; };
const guildMemberDto = guild_member const guildMemberDto = guild_member
@ -113,8 +117,7 @@ router.get(
guild_member.communication_disabled_until, guild_member.communication_disabled_until,
deaf: guild_member.deaf, deaf: guild_member.deaf,
flags: user.flags, flags: user.flags,
is_pending: guild_member.pending, pending: guild_member.pending,
pending: guild_member.pending, // why is this here twice, discord?
joined_at: guild_member.joined_at, joined_at: guild_member.joined_at,
mute: guild_member.mute, mute: guild_member.mute,
nick: guild_member.nick, nick: guild_member.nick,
@ -131,6 +134,9 @@ router.get(
banner: guild_member?.banner || null, banner: guild_member?.banner || null,
bio: guild_member?.bio || "", bio: guild_member?.bio || "",
guild_id, guild_id,
theme_colors: null,
emoji: null, // TODO:
popout_animation_particle_type: null, // TODO:
}; };
res.json({ res.json({
connected_accounts: user.connected_accounts.filter( connected_accounts: user.connected_accounts.filter(
@ -145,6 +151,8 @@ router.get(
user_profile: userProfile, user_profile: userProfile,
guild_member: guild_id && guildMemberDto, guild_member: guild_id && guildMemberDto,
guild_member_profile: guild_id && guildMemberProfile, guild_member_profile: guild_id && guildMemberProfile,
guild_badges: [], // TODO:
badges: [], // TODO:
}); });
}, },
); );

View File

@ -48,8 +48,10 @@ export enum PublicUserEnum {
id, id,
public_flags, public_flags,
avatar, avatar,
avatar_decoration,
accent_color, accent_color,
banner, banner,
banner_color,
bio, bio,
bot, bot,
premium_since, premium_since,
@ -103,12 +105,18 @@ export class User extends BaseClass {
@Column({ nullable: true }) @Column({ nullable: true })
avatar?: string; // hash of the user avatar avatar?: string; // hash of the user avatar
@Column({ nullable: true })
avatar_decoration?: string; // hash of the users avatar decoration
@Column({ nullable: true }) @Column({ nullable: true })
accent_color?: number; // banner color of user accent_color?: number; // banner color of user
@Column({ nullable: true }) @Column({ nullable: true })
banner?: string; // hash of the user banner 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 // TODO: Separate `User` and `UserProfile` models
// puyo: changed from [number, number] because it breaks openapi // puyo: changed from [number, number] because it breaks openapi
@Column({ nullable: true, type: "simple-array" }) @Column({ nullable: true, type: "simple-array" })