chore: simple voice support

This commit is contained in:
izzy
2025-09-30 14:30:17 -05:00
parent 7e8bd0c817
commit db29367286
2 changed files with 15 additions and 0 deletions
+9
View File
@@ -321,6 +321,15 @@ export class Channel {
?.messageMentionIds;
}
/**
* Whether this is a 'voice chats v2' channel
*
* NB. subject to change as vc(2) goes to production
*/
get isVoice(): boolean {
return this.#collection.getUnderlyingObject(this.id).voice;
}
/**
* URL to the channel icon
*/
+6
View File
@@ -29,6 +29,8 @@ export type HydratedChannel = {
nsfw: boolean;
lastMessageId?: string;
voice: boolean;
};
export const channelHydration: Hydrate<Merge<APIChannel>, HydratedChannel> = {
@@ -60,6 +62,10 @@ export const channelHydration: Hydrate<Merge<APIChannel>, HydratedChannel> = {
rolePermissions: (channel) => channel.role_permissions,
nsfw: (channel) => channel.nsfw || false,
lastMessageId: (channel) => channel.last_message_id!,
voice: (channel) => {
console.info(channel);
return typeof (channel as never as { voice: object }).voice === "object";
},
},
initialHydration: () => ({
typingIds: new ReactiveSet(),