VOICE_STATE_UPDATE implementation, fix #210

This commit is contained in:
AlTech98
2021-09-02 19:33:04 +02:00
parent c410fbcc0d
commit 8ff56b1f9e
11 changed files with 142 additions and 24 deletions
+11
View File
@@ -0,0 +1,11 @@
export function genSessionId() {
return genRanHex(32)
}
export function genVoiceToken() {
return genRanHex(16)
}
function genRanHex(size: number) {
return [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
}
+1
View File
@@ -6,6 +6,7 @@ import { Channel } from "amqplib";
interface WebSocket extends WS {
version: number;
user_id: string;
session_id: string;
encoding: "etf" | "json";
compress?: "zlib-stream";
shard_count?: bigint;