summary refs log tree commit diff
path: root/gateway/src/events/Close.ts
blob: d68fc751c5933da409e92b3dfc69a4427567eab2 (plain) (blame)
1
2
3
4
5
6
7
8
9
import WebSocket from "../util/WebSocket";
import { Message } from "./Message";
import { Session } from "@fosscord/util";

export async function Close(this: WebSocket, code: number, reason: string) {
	await Session.delete({ session_id: this.session_id });
	// @ts-ignore
	this.off("message", Message);
}