From db29367286bcae7ce43e8ed29203cbf77810a0d7 Mon Sep 17 00:00:00 2001 From: izzy Date: Tue, 30 Sep 2025 14:30:17 -0500 Subject: [PATCH] chore: simple voice support --- src/classes/Channel.ts | 9 +++++++++ src/hydration/channel.ts | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/src/classes/Channel.ts b/src/classes/Channel.ts index eb7b4917..f5dd3a84 100644 --- a/src/classes/Channel.ts +++ b/src/classes/Channel.ts @@ -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 */ diff --git a/src/hydration/channel.ts b/src/hydration/channel.ts index 5307ff6f..6a861948 100644 --- a/src/hydration/channel.ts +++ b/src/hydration/channel.ts @@ -29,6 +29,8 @@ export type HydratedChannel = { nsfw: boolean; lastMessageId?: string; + + voice: boolean; }; export const channelHydration: Hydrate, HydratedChannel> = { @@ -60,6 +62,10 @@ export const channelHydration: Hydrate, 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(),