1 files changed, 12 insertions, 0 deletions
diff --git a/gateway/src/opcodes/Heartbeat.ts b/gateway/src/opcodes/Heartbeat.ts
new file mode 100644
index 00000000..015257b9
--- /dev/null
+++ b/gateway/src/opcodes/Heartbeat.ts
@@ -0,0 +1,12 @@
+import { CLOSECODES, Payload } from "../util/Constants";
+import { Send } from "../util/Send";
+import { setHeartbeat } from "../util/setHeartbeat";
+import WebSocket from "../util/WebSocket";
+
+export async function onHeartbeat(this: WebSocket, data: Payload) {
+ // TODO: validate payload
+
+ setHeartbeat(this);
+
+ await Send(this, { op: 11 });
+}
|