Skip to content

Commit fcc8b0e

Browse files
committed
feat: add Channel#joinCall
1 parent 2a4dac5 commit fcc8b0e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/classes/Channel.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,22 @@ export class Channel {
795795
);
796796
}
797797

798+
/**
799+
* Join a call
800+
* @param node Target node
801+
* @param forceDisconnect Whether to disconnect existing call
802+
* @param recipients Ring targets
803+
* @returns LiveKit URL and Token
804+
*/
805+
async joinCall(node = undefined, forceDisconnect = true, recipients: (User | string)[]) {
806+
return await this.#collection.client.api.post(
807+
`/channels/${this.id as ''}/join_call`, {
808+
node,
809+
recipients: recipients.map(entry => typeof entry === 'string' ? entry : entry.id),
810+
force_disconnect: forceDisconnect
811+
});
812+
}
813+
798814
/**
799815
* Start typing in this channel
800816
* @requires `DirectMessage`, `Group`, `TextChannel`

0 commit comments

Comments
 (0)