summary refs log tree commit diff
path: root/src/gateway/opcodes/Heartbeat.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/gateway/opcodes/Heartbeat.ts')
-rw-r--r--src/gateway/opcodes/Heartbeat.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gateway/opcodes/Heartbeat.ts b/src/gateway/opcodes/Heartbeat.ts
new file mode 100644
index 00000000..42b72d4b
--- /dev/null
+++ b/src/gateway/opcodes/Heartbeat.ts
@@ -0,0 +1,11 @@
+import { Payload, WebSocket } from "@fosscord/gateway";
+import { setHeartbeat } from "../util/Heartbeat";
+import { Send } from "../util/Send";
+
+export async function onHeartbeat(this: WebSocket, _data: Payload) {
+	// TODO: validate payload
+
+	setHeartbeat(this);
+
+	await Send(this, { op: 11 });
+}