mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-22 04:55:30 -04:00
API: Add support for voice channels.
API: Add support for replies.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "revolt.js",
|
||||
"version": "4.3.1-alpha.0",
|
||||
"version": "4.3.2",
|
||||
"main": "dist/index.js",
|
||||
"repository": "https://gitlab.insrt.uk/revolt/revolt.js",
|
||||
"author": "Paul Makles <insrt.uk>",
|
||||
|
||||
+13
-5
@@ -175,18 +175,25 @@ export namespace Channels {
|
||||
icon?: Attachment
|
||||
}
|
||||
|
||||
export type TextChannel = {
|
||||
export type ServerChannel = {
|
||||
_id: string,
|
||||
channel_type: 'TextChannel',
|
||||
server: string,
|
||||
|
||||
name: string,
|
||||
description: string,
|
||||
icon?: Attachment,
|
||||
icon?: Attachment
|
||||
}
|
||||
|
||||
export type TextChannel = ServerChannel & {
|
||||
channel_type: 'TextChannel',
|
||||
last_message: string
|
||||
}
|
||||
|
||||
export type Channel = (SavedMessagesChannel | DirectMessageChannel | GroupChannel | TextChannel) & { nonce?: string }
|
||||
export type VoiceChannel = ServerChannel & {
|
||||
channel_type: 'VoiceChannel'
|
||||
}
|
||||
|
||||
export type Channel = (SavedMessagesChannel | DirectMessageChannel | GroupChannel | TextChannel | VoiceChannel) & { nonce?: string }
|
||||
|
||||
export type Message = {
|
||||
_id: string,
|
||||
@@ -198,7 +205,8 @@ export namespace Channels {
|
||||
attachments?: Attachment[],
|
||||
edited?: { $date: string },
|
||||
embeds?: Embed[],
|
||||
mentions?: string[]
|
||||
mentions?: string[],
|
||||
replies?: string[]
|
||||
}
|
||||
|
||||
export type SystemMessage =
|
||||
|
||||
@@ -94,7 +94,8 @@ export class PermissionCalculator {
|
||||
+ ChannelPermission.ManageChannel
|
||||
+ ChannelPermission.VoiceCall
|
||||
+ ChannelPermission.InviteOthers;
|
||||
case 'TextChannel': {
|
||||
case 'TextChannel':
|
||||
case 'VoiceChannel': {
|
||||
let server = this.client.servers.get(channel.server);
|
||||
if (typeof server === 'undefined') return 0;
|
||||
|
||||
@@ -103,6 +104,7 @@ export class PermissionCalculator {
|
||||
} else {
|
||||
return ChannelPermission.View
|
||||
+ ChannelPermission.SendMessage
|
||||
+ ChannelPermission.VoiceCall
|
||||
+ ChannelPermission.InviteOthers;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -369,7 +369,8 @@ type Routes =
|
||||
data: {
|
||||
content: string,
|
||||
nonce: string,
|
||||
attachments?: string[]
|
||||
attachments?: string[],
|
||||
replies?: { id: string, mention: boolean }[]
|
||||
},
|
||||
response: Channels.Message
|
||||
}
|
||||
@@ -524,15 +525,16 @@ type Routes =
|
||||
response: Servers.Ban[]
|
||||
}
|
||||
| {
|
||||
// Create a new text channel for a server
|
||||
// Create a new server channel
|
||||
method: 'POST',
|
||||
route: `/servers/${Id}/channels`,
|
||||
data: {
|
||||
type?: 'Text' | 'Voice',
|
||||
name: string,
|
||||
description?: string,
|
||||
nonce: string
|
||||
},
|
||||
response: Channels.TextChannel
|
||||
response: Channels.TextChannel | Channels.VoiceChannel
|
||||
}
|
||||
| {
|
||||
// Fetch a server's invites
|
||||
|
||||
Reference in New Issue
Block a user