summary refs log tree commit diff
path: root/src/opcodes/Heartbeat.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/opcodes/Heartbeat.ts')
-rw-r--r--src/opcodes/Heartbeat.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/opcodes/Heartbeat.ts b/src/opcodes/Heartbeat.ts
new file mode 100644

index 00000000..d7e7fb5f --- /dev/null +++ b/src/opcodes/Heartbeat.ts
@@ -0,0 +1,10 @@ +import { Payload } from "../util/Constants"; +import { Send } from "../util/Send"; +import { setHeartbeat } from "../util/setHeartbeat"; +import WebSocket from "../util/WebSocket"; + +export function onHeartbeat(this: WebSocket, data: Payload) { + setHeartbeat(this); + + Send(this, { op: 11 }); +}