Added utils and schema for cry/hug/pat-related commands

master
Kit Kasune 4 years ago
parent e0a88ff461
commit c9e25c7d99
  1. 2
      bot.js
  2. 8
      models/saves.js
  3. 10
      util/makeid.js

@ -13,6 +13,8 @@ async function init() {
['command', 'event'].forEach(x => require(`./handle/${x}`)(client));
client.developers = ["330547934951112705", "673477059904929802"];
client.misc = {};
client.misc.savers = ['497598953206841375'];
client.utils = {};
client.utils.logch = async () => {return client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915');};

@ -0,0 +1,8 @@
const mongoose = require('mongoose');
const SaveSchema = new mongoose.Schema({
name: {type: String, unique: true},
saves: {type: Map, default: new Map()}
});
module.exports = mongoose.model('saves', SaveSchema);

@ -0,0 +1,10 @@
module.exports = (length) => {
let result = '';
let characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
let charactersLength = characters.length;
let i;
for (i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
Loading…
Cancel
Save