UNPKG

constatic

Version:
19 lines (18 loc) 427 B
import { Schema } from "mongoose"; import { t } from "../utils.js"; export const guildSchema = new Schema( { id: t.string, channels: { logs: t.channelInfo, general: t.channelInfo, } }, { statics: { async get(id: string) { return await this.findOne({ id }) ?? this.create({ id }); } } } );