@sonata-sdk/voice 0.1.0 → 0.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/dist/connection.d.ts +1 -0
- package/dist/connection.js +3 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/connection.d.ts
CHANGED
package/dist/connection.js
CHANGED
|
@@ -49,7 +49,7 @@ export class VoiceConnection extends EventEmitter {
|
|
|
49
49
|
this.emit('ready');
|
|
50
50
|
});
|
|
51
51
|
this.#gateway.on('close', (code, reason) => {
|
|
52
|
-
this.state = { status: 'disconnected', reason, code };
|
|
52
|
+
this.state = { status: 'disconnected', reason, code, closeReason: reason };
|
|
53
53
|
this.emit('stateChange', { status: 'connected' }, this.state);
|
|
54
54
|
});
|
|
55
55
|
this.#gateway.on('error', (err) => this.emit('error', err));
|
|
@@ -67,6 +67,8 @@ export class VoiceConnection extends EventEmitter {
|
|
|
67
67
|
this.#token = obj.token;
|
|
68
68
|
this.#endpoint = obj.endpoint;
|
|
69
69
|
this.#gateway.voiceServerUpdate(obj.token, obj.endpoint, obj.channelId ?? obj.channel_id);
|
|
70
|
+
}
|
|
71
|
+
connect() {
|
|
70
72
|
this.#gateway.connect();
|
|
71
73
|
}
|
|
72
74
|
sendAudioFrame(frame) {
|
package/dist/types.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export interface ConnectionState {
|
|
|
10
10
|
status: 'connecting' | 'connected' | 'disconnected' | 'destroyed';
|
|
11
11
|
reason: string | null;
|
|
12
12
|
code: number | null;
|
|
13
|
+
closeReason?: string | null;
|
|
13
14
|
}
|
|
14
15
|
export interface PlayerState {
|
|
15
16
|
status: 'playing' | 'paused' | 'stopped';
|