mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-18 16:34:27 -04:00
feat: add pronouns (#169)
* feat: pronouns Signed-off-by: İspik <ispik@ispik.dev> * feat: add pronouns Signed-off-by: İspik <ispik@ispik.dev> --------- Signed-off-by: İspik <ispik@ispik.dev>
This commit is contained in:
@@ -94,6 +94,13 @@ export class ServerMember {
|
||||
return this.#collection.getUnderlyingObject(key(this.id)).avatar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pronouns
|
||||
*/
|
||||
get pronouns(): string | undefined {
|
||||
return this.#collection.getUnderlyingObject(key(this.id)).pronouns;
|
||||
}
|
||||
|
||||
/**
|
||||
* List of role IDs
|
||||
*/
|
||||
|
||||
@@ -93,6 +93,13 @@ export class User {
|
||||
return this.#collection.getUnderlyingObject(this.id).avatar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pronouns
|
||||
*/
|
||||
get pronouns(): string | undefined {
|
||||
return this.#collection.getUnderlyingObject(this.id).pronouns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Badges
|
||||
*/
|
||||
|
||||
@@ -798,6 +798,9 @@ export async function handleEvent(
|
||||
case "Timeout":
|
||||
changes["timeout"] = undefined;
|
||||
break;
|
||||
case "Pronouns":
|
||||
changes["pronouns"] = undefined;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -869,6 +872,9 @@ export async function handleEvent(
|
||||
text: undefined,
|
||||
};
|
||||
break;
|
||||
case "Pronouns":
|
||||
changes["pronouns"] = undefined;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ export type HydratedServerMember = {
|
||||
joinedAt: Date;
|
||||
nickname?: string;
|
||||
avatar?: File;
|
||||
pronouns?: string;
|
||||
roles: string[];
|
||||
timeout?: Date;
|
||||
};
|
||||
@@ -28,6 +29,7 @@ export const serverMemberHydration: Hydrate<
|
||||
joinedAt: (member) => new Date(member.joined_at),
|
||||
nickname: (member) => member.nickname!,
|
||||
avatar: (member, ctx) => new File(ctx as Client, member.avatar!),
|
||||
pronouns: (member) => member.pronouns!,
|
||||
roles: (member) => member.roles,
|
||||
timeout: (member) => new Date(member.timeout!),
|
||||
},
|
||||
|
||||
@@ -25,6 +25,7 @@ export type HydratedUser = {
|
||||
flags: UserFlags;
|
||||
|
||||
avatar?: File;
|
||||
pronouns?: string;
|
||||
status?: UserStatus;
|
||||
bot?: BotInformation;
|
||||
};
|
||||
@@ -49,6 +50,7 @@ export const userHydration: Hydrate<APIUser, HydratedUser> = {
|
||||
flags: (user) => user.flags!,
|
||||
|
||||
avatar: (user, ctx) => new File(ctx as Client, user.avatar!),
|
||||
pronouns: (user) => user.pronouns,
|
||||
status: (user) => user.status!,
|
||||
bot: (user) => user.bot!,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user