2021-03-08 22:55:20 +03:00
|
|
|
const mongoose = require('mongoose');
|
|
|
|
|
|
|
|
const userSchema = new mongoose.Schema({
|
|
|
|
uid: Number,
|
2021-04-12 22:51:12 +03:00
|
|
|
name: String,
|
2021-03-08 22:55:20 +03:00
|
|
|
username: String,
|
|
|
|
messagesCount: {type: Number, default: 0},
|
|
|
|
karma: {type: Number, default: 0},
|
|
|
|
karmaChanged: {type: Number, default: 0},
|
|
|
|
karmaGot: {type: Number, default: 0},
|
|
|
|
lastKarmaShot: {type: Date, default: 0},
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const chatSchema = new mongoose.Schema({
|
|
|
|
uid: Number,
|
|
|
|
title: String,
|
|
|
|
main: Boolean,
|
|
|
|
users: [Number],
|
|
|
|
currentState: {type: Number, default: 0},
|
|
|
|
lastOfftop: {type: Date, default: 0},
|
|
|
|
options:
|
|
|
|
{
|
|
|
|
offtopCooldown: {type: Number, default: 60},
|
|
|
|
karmaCooldown: {type: Number, default: 60},
|
2021-03-21 16:47:58 +03:00
|
|
|
maxWarnings: {type: Number, default: 3}
|
|
|
|
},
|
2021-03-08 22:55:20 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
const triggerSchema = new mongoose.Schema({
|
|
|
|
trigger: String,
|
|
|
|
text: String,
|
|
|
|
show: {type: Boolean, default: false}
|
|
|
|
})
|
|
|
|
|
2021-03-21 16:47:58 +03:00
|
|
|
const warningSchema = new mongoose.Schema({
|
|
|
|
user: Number,
|
|
|
|
chat: Number,
|
|
|
|
msg: String,
|
|
|
|
active: {type: Boolean, default: true},
|
|
|
|
date: {type: Date, default: Date.now}
|
|
|
|
})
|
|
|
|
|
2021-03-08 22:55:20 +03:00
|
|
|
|
2021-03-21 16:47:58 +03:00
|
|
|
module.exports = {userSchema, chatSchema, triggerSchema, warningSchema}
|