Add join_call.

This commit is contained in:
Paul
2021-03-31 14:10:40 +01:00
parent cec93fa513
commit 65ef95c853
4 changed files with 18 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "revolt.js",
"version": "4.0.0-alpha.16",
"version": "4.1.0-alpha.0",
"main": "dist/index.js",
"repository": "https://gitlab.insrt.uk/revolt/revolt.js",
"author": "Paul Makles <insrt.uk>",
+12
View File
@@ -367,6 +367,18 @@ type Routes =
route: '/push/unsubscribe',
data: undefined,
response: undefined
} |
/**
* Voice API
*/
{
// Join voice call for channel.
method: 'POST',
route: '/channels/:id/join_call',
data: undefined,
response: {
token: string
}
}
// ? Below are Typescript typings for extracting route data from the object above.
+1 -1
View File
@@ -1,7 +1,7 @@
export * from './Client';
export { Channel, User, Message } from './api/objects';
export const LIBRARY_VERSION = '4.0.0-alpha.16';
export const LIBRARY_VERSION = '4.1.0-alpha.0';
export const defaultConfig = {
apiURL: 'https://api.revolt.chat',
+4
View File
@@ -116,4 +116,8 @@ export default class Channels extends Collection<Channel> {
await this.client.req<'DELETE', '/channels/:id/messages/:id'>('DELETE', `/channels/${id}/messages/${message_id}` as any);
this.client.emit('message/delete', message_id);
}
async joinCall(id: string) {
return await this.client.req<'POST', '/channels/:id/join_call'>('POST', `/channels/${id}/join_call` as any);
}
}