@satorijs/adapter-discord 3.0.2 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bot.d.ts +5 -5
- package/lib/index.js +40 -57
- package/lib/index.js.map +3 -3
- package/lib/types/device.d.ts +41 -0
- package/lib/utils.d.ts +2 -3
- package/lib/ws.d.ts +1 -2
- package/package.json +4 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** https://discord.com/developers/docs/topics/certified-devices#models-device-object */
|
|
2
|
+
export interface Device {
|
|
3
|
+
/** the type of device */
|
|
4
|
+
type: DeviceType;
|
|
5
|
+
/** the device's Windows UUID */
|
|
6
|
+
id: string;
|
|
7
|
+
/** the hardware vendor */
|
|
8
|
+
vendor: Vendor;
|
|
9
|
+
/** the model of the product */
|
|
10
|
+
model: Model;
|
|
11
|
+
/** UUIDs of related devices */
|
|
12
|
+
related: string[];
|
|
13
|
+
/** if the device's native echo cancellation is enabled */
|
|
14
|
+
echo_cancellation?: boolean;
|
|
15
|
+
/** if the device's native noise suppression is enabled */
|
|
16
|
+
noise_suppression?: boolean;
|
|
17
|
+
/** if the device's native automatic gain control is enabled */
|
|
18
|
+
automatic_gain_control?: boolean;
|
|
19
|
+
/** if the device is hardware muted */
|
|
20
|
+
hardware_mute?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** https://discord.com/developers/docs/topics/certified-devices#models-vendor-object */
|
|
23
|
+
export interface Vendor {
|
|
24
|
+
/** name of the vendor */
|
|
25
|
+
name: string;
|
|
26
|
+
/** url for the vendor */
|
|
27
|
+
url: string;
|
|
28
|
+
}
|
|
29
|
+
/** https://discord.com/developers/docs/topics/certified-devices#models-model-object */
|
|
30
|
+
export interface Model {
|
|
31
|
+
/** name of the model */
|
|
32
|
+
name: string;
|
|
33
|
+
/** url for the model */
|
|
34
|
+
url: string;
|
|
35
|
+
}
|
|
36
|
+
/** https://discord.com/developers/docs/topics/certified-devices#models-device-type */
|
|
37
|
+
export declare enum DeviceType {
|
|
38
|
+
AUDIO_INPUT = "audioinput",
|
|
39
|
+
AUDIO_OUTPUT = "audiooutput",
|
|
40
|
+
VIDEO_INPUT = "videoinput"
|
|
41
|
+
}
|
package/lib/utils.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export declare const adaptUser: (user: Discord.User) => User;
|
|
|
5
5
|
export declare const adaptGuild: (data: Discord.Guild) => Guild;
|
|
6
6
|
export declare const adaptChannel: (data: Discord.Channel) => Channel;
|
|
7
7
|
export declare const adaptAuthor: (author: Discord.User) => Author;
|
|
8
|
-
export declare function adaptMessage(meta: Discord.Message, session?: Partial<Session>): Message
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function prepareMessageSession(session: Partial<Session>, data: Partial<Discord.Message>): void;
|
|
8
|
+
export declare function adaptMessage(bot: DiscordBot, meta: Discord.Message, session?: Partial<Session>): Promise<Message>;
|
|
9
|
+
export declare function prepareMessage(session: Partial<Session>, data: Partial<Discord.Message>): void;
|
|
11
10
|
export declare function adaptSession(bot: DiscordBot, input: Discord.GatewayPayload): Promise<Session<import("@satorijs/core").Context>>;
|
package/lib/ws.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
/// <reference types="ws" />
|
|
3
2
|
import { Adapter, Schema } from '@satorijs/satori';
|
|
4
3
|
import { DiscordBot } from './bot';
|
|
5
4
|
export declare class WsClient extends Adapter.WsClient<DiscordBot> {
|
|
6
5
|
_d: number;
|
|
7
6
|
_ping: NodeJS.Timeout;
|
|
8
7
|
_sessionId: string;
|
|
9
|
-
prepare():
|
|
8
|
+
prepare(): any;
|
|
10
9
|
heartbeat(): void;
|
|
11
10
|
accept(): void;
|
|
12
11
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@satorijs/adapter-discord",
|
|
3
3
|
"description": "Discord Adapter for Satorijs",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.1",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"@types/es-aggregate-error": "^1.0.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@satorijs/satori": "^1.
|
|
35
|
+
"@satorijs/satori": "^1.1.2"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"es-aggregate-error": "^1.0.
|
|
39
|
-
"file-type": "^16.5.
|
|
38
|
+
"es-aggregate-error": "^1.0.8",
|
|
39
|
+
"file-type": "^16.5.4",
|
|
40
40
|
"form-data": "^4.0.0"
|
|
41
41
|
}
|
|
42
42
|
}
|