From fcc8b0e19510c9848baf563e2ebd5ba93bb5f35d Mon Sep 17 00:00:00 2001 From: izzy Date: Wed, 22 Oct 2025 21:04:14 +0100 Subject: [PATCH] feat: add Channel#joinCall --- src/classes/Channel.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/classes/Channel.ts b/src/classes/Channel.ts index 1ff18d38..dd4af61d 100644 --- a/src/classes/Channel.ts +++ b/src/classes/Channel.ts @@ -795,6 +795,22 @@ export class Channel { ); } + /** + * Join a call + * @param node Target node + * @param forceDisconnect Whether to disconnect existing call + * @param recipients Ring targets + * @returns LiveKit URL and Token + */ + async joinCall(node = undefined, forceDisconnect = true, recipients: (User | string)[]) { + return await this.#collection.client.api.post( + `/channels/${this.id as ''}/join_call`, { + node, + recipients: recipients.map(entry => typeof entry === 'string' ? entry : entry.id), + force_disconnect: forceDisconnect + }); + } + /** * Start typing in this channel * @requires `DirectMessage`, `Group`, `TextChannel`