eris/app/adminStore.ts

12 lines
302 B
TypeScript
Raw Normal View History

2023-11-20 00:33:38 +00:00
import { Static, t } from "elysia";
2023-10-23 00:39:01 +00:00
import { db } from "./db.ts";
2023-11-20 00:33:38 +00:00
import { Tkv } from "../utils/Tkv.ts";
2023-10-23 00:39:01 +00:00
2023-11-20 00:33:38 +00:00
export const adminSchema = t.Object({
promotedBy: t.Nullable(t.Number()),
});
2023-10-23 00:39:01 +00:00
2023-11-20 00:33:38 +00:00
export type Admin = Static<typeof adminSchema>;
2023-10-23 00:39:01 +00:00
2023-11-20 00:33:38 +00:00
export const adminStore = new Tkv<["admins", number], Admin>(db);