2019-09-13 20:02:41 +00:00
|
|
|
// database stuff
|
2020-07-27 00:52:13 +00:00
|
|
|
const mongoose = require("mongoose");
|
|
|
|
mongoose.connect(process.env.MONGO, { poolSize: 10, bufferMaxEntries: 0, useNewUrlParser: true, useUnifiedTopology: true });
|
|
|
|
const guildSchema = new mongoose.Schema({
|
|
|
|
id: String,
|
|
|
|
tags: Map,
|
|
|
|
prefix: String,
|
|
|
|
warns: Map,
|
|
|
|
disabledChannels: [String]
|
2019-10-28 20:21:06 +00:00
|
|
|
});
|
2020-07-27 00:52:13 +00:00
|
|
|
const Guild = mongoose.model("Guild", guildSchema);
|
|
|
|
|
|
|
|
const globalSchema = new mongoose.Schema({
|
|
|
|
cmdCounts: Map
|
|
|
|
});
|
|
|
|
const Global = mongoose.model("Global", globalSchema);
|
|
|
|
|
|
|
|
exports.guilds = Guild;
|
|
|
|
exports.global = Global;
|
|
|
|
exports.connection = mongoose.connection;
|