mirror of
https://github.com/aydenjahola/discord-multipurpose-bot.git
synced 2024-11-24 17:55:56 +00:00
19 lines
659 B
JavaScript
19 lines
659 B
JavaScript
|
const mongoose = require("mongoose");
|
||
|
const { v4: uuidv4 } = require("uuid");
|
||
|
|
||
|
const gameStatusEnum = {
|
||
|
values: ["ongoing", "ended"],
|
||
|
message: 'Status must be either "ongoing" or "ended"',
|
||
|
};
|
||
|
|
||
|
const spyfallGameSchema = new mongoose.Schema({
|
||
|
gameId: { type: String, required: true, unique: true, default: uuidv4 },
|
||
|
guildId: { type: String, required: true },
|
||
|
location: { type: String, required: true },
|
||
|
spy: { type: String, required: true },
|
||
|
players: { type: [String], required: true },
|
||
|
status: { type: String, enum: gameStatusEnum, default: "ongoing" },
|
||
|
});
|
||
|
|
||
|
module.exports = mongoose.model("SpyfallGame", spyfallGameSchema);
|