import type { ServerWebSocket } from "bun";
import type { WebSocketData } from "@WS/.";

type Param = {
    ws: ServerWebSocket<WebSocketData>;
};

export default async function socketOpen({ ws }: Param) {
    const user = ws.data.user;
    console.log(`Web Socket Opened by ${user.first_name}`);
    global.ACTIVE_USERS.push({ ...user, ws });
}
