mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-18 08:31:20 -04:00
feat: add Channel#joinCall
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user