9 lines
403 B
TypeScript
9 lines
403 B
TypeScript
import type {Socket} from "socket.io-client";
|
|
import {ensure_forward} from "../../bot/forward/manager.ts";
|
|
|
|
export async function handler(socket: Socket, data: unknown, callback: unknown) {
|
|
if (typeof callback !== "function") return;
|
|
const response = await ensure_forward(socket, data);
|
|
try { callback(response); } catch { /* Main may have disconnected while the request was pending. */ }
|
|
}
|