@elara-services/leveling
Version:
A package for XP/Leveling on Discord.
151 lines (150 loc) • 3.53 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.weekly = exports.settings = exports.users = void 0;
const mongoose_1 = require("mongoose");
const t = {
string: (def = "") => ({ type: String, default: def }),
boolean: (def = true) => ({ type: Boolean, default: def }),
array: (def = []) => ({
type: Array,
default: def,
}),
num: (def = 0) => ({ type: Number, default: def }),
};
const options = {
content: t.string(),
embeds: t.array(),
};
exports.users = new mongoose_1.Schema({
userId: t.string(),
guildId: t.string(),
xp: t.num(),
level: t.num(),
foreground: t.string(),
background: t.string(),
voice: {
duration: t.num(),
multiplier: t.num(),
},
toggles: {
locked: t.boolean(false),
dms: t.boolean(),
pings: t.boolean(),
},
stats: [
new mongoose_1.Schema({
name: t.string(),
count: t.num(),
}),
],
colors: [
new mongoose_1.Schema({
type: t.string(),
color: t.string(),
}),
],
cooldowns: [
new mongoose_1.Schema({
name: t.string(),
date: t.num(),
cooldown: t.num(),
}),
],
});
exports.settings = new mongoose_1.Schema({
guildId: t.string(),
enabled: t.boolean(false),
cooldown: t.num(60),
background: {
url: t.string(),
color: t.string(),
},
webhook: {
name: t.string(),
image: t.string(),
},
xp: {
min: t.num(1),
max: t.num(8),
},
announce: {
channel: {
enabled: t.boolean(),
ping: t.boolean(),
channel: t.string(),
options,
},
dm: {
enabled: t.boolean(false),
options,
},
weekly: {
enabled: t.boolean(false),
channel: t.string(),
roles: t.array(),
},
},
ignore: {
channels: t.array(),
roles: t.array(),
users: t.array(),
},
levels: [
new mongoose_1.Schema({
level: t.num(),
levelName: t.string(),
options,
roles: {
add: t.array(),
remove: t.array(),
},
}),
],
multipliers: [
new mongoose_1.Schema({
channels: t.array(),
roles: t.array(),
multiplier: t.num(),
}),
],
cooldowns: [
new mongoose_1.Schema({
roles: t.array(),
seconds: t.num(),
}),
],
toggles: {
onlyRegisteredLevels: t.boolean(false),
useWebhook: t.boolean(true),
stackRoles: t.boolean(false),
resetOnLeave: t.boolean(false),
earnXPOnSlashCommands: t.boolean(false),
weekly: {
track: t.boolean(false),
},
voice: {
xp: t.boolean(false),
shouldBeUnmuted: t.boolean(true),
},
},
});
exports.weekly = new mongoose_1.Schema({
guildId: t.string(),
id: t.string(),
endOfWeek: t.string(),
announced: t.boolean(false),
users: [
new mongoose_1.Schema({
userId: t.string(),
messages: t.num(),
level: t.num(),
voice: t.num(),
xp: t.num(),
}),
],
stats: {
messages: t.num(),
voice: t.num(),
xp: t.num(),
},
});