🎨 restructure gateway

This commit is contained in:
Flam3rboy
2021-10-02 15:12:47 +02:00
parent 66e2db8d88
commit 1716d92849
9 changed files with 36 additions and 12 deletions
+5 -2
View File
@@ -35,8 +35,11 @@ export async function Connection(
// @ts-ignore
socket.encoding = searchParams.get("encoding") || "json";
if (!["json", "etf"].includes(socket.encoding)) {
if (socket.encoding === "etf" && erlpack)
throw new Error("Erlpack is not installed: 'npm i -D erlpack'");
if (socket.encoding === "etf" && erlpack) {
throw new Error(
"Erlpack is not installed: 'npm i @yukikaze-bot/erlpack'"
);
}
return socket.close(CLOSECODES.Decode_error);
}