summary refs log tree commit diff
path: root/gateway/src/opcodes/Heartbeat.ts
blob: 015257b9882be962d389faf9fc6f492e68935d57 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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 });
}