summary refs log tree commit diff
path: root/src/util/Event.ts
blob: 39389cbb1c726ed83067508e7e7c53910b1175f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
import { Event, EventModel } from "fosscord-server-util";

export async function emitEvent(payload: Omit<Event, "created_at">) {
	const emitEvent = {
		created_at: new Date(), // in seconds
		...payload,
	};

	return await new EventModel(emitEvent).save();
}