function partyHandler(partyServer) {
	return eventHandler({
		handler: (e) => {},
		websocket: {
			async open(peer) {
				const party = await getParty(partyServer, peer.url);
				await party.onConnect(peer);
				return await partyServer.onConnect?.(party, peer);
			},
			async close(peer, details) {
				const party = await getParty(partyServer, peer.url);
				await party.onClose(peer);
				return await partyServer.onClose?.(party, peer);
			},
			async message(peer, message) {
				const party = await getParty(partyServer, peer.url);
				return await partyServer.onMessage?.(party, message, peer);
			},
			async error(peer, error) {
				const party = await getParty(partyServer, peer.url);
				return await partyServer.onError?.(party, peer, error);
			},
		},
	});
}
@param {import('../types/party.d.ts').PartyHandler} partyServer