Added snowflake and experimental xp system, made logger easier to use

This commit is contained in:
TheEssem 2019-11-05 09:52:46 -06:00
parent 606c1ea1dc
commit 171253c52c
12 changed files with 137 additions and 43 deletions

View file

@ -8,4 +8,14 @@ const guildSchema = new mongoose.Schema({
prefix: String
});
const Guild = mongoose.model("Guild", guildSchema);
module.exports = Guild;
/*const membersSchema = new mongoose.Schema({
});*/
const xpSchema = new mongoose.Schema({
id: String,
members: Map,
enabled: Boolean
});
const XP = mongoose.model("XP", xpSchema);
exports.guilds = Guild;
exports.xp = XP;

View file

@ -9,7 +9,7 @@ const logger = winston.createLogger({
format: winston.format.printf(log => `[${moment().format("YYYY-MM-DD HH:mm:ss")}]: [${log.level.toUpperCase()}] - ${log.message}`)
});
exports.log = (type = "info", content) => logger.log(type, content);
exports.log = (type, content) => content ? logger.log(type, content) : logger.log("info", content);
exports.error = (...args) => this.log("error", ...args);