Migrated database to PostgreSQL, updated packages

This commit is contained in:
TheEssem 2020-07-10 12:07:24 -05:00
parent 0760136ded
commit 2a67b76169
15 changed files with 362 additions and 570 deletions

View file

@ -1,12 +1,15 @@
const db = require("../utils/database.js"); const { writeFile } = require("fs");
const { promisify } = require("util");
const tweets = require("../tweets.json");
const twitter = require("../utils/twitter.js");
exports.run = async (message, args) => { exports.run = async (message, args) => {
if (message.author.id !== process.env.OWNER) return `${message.author.mention}, only the bot owner can add tweets!`; if (message.author.id !== process.env.OWNER) return `${message.author.mention}, only the bot owner can add tweets!`;
if (args.length === 0) return `${message.author.mention}, you need to provide some text to add to the tweet database!`; if (args.length === 0) return `${message.author.mention}, you need to provide some text to add to the tweet database!`;
if (args[1] === undefined) return `${message.author.mention}, you need to provide the content you want to add!`; if (args[1] === undefined) return `${message.author.mention}, you need to provide the content you want to add!`;
const tweets = (await db.tweets.find({ enabled: true }).exec())[0];
tweets[args[0]].push(args.slice(1).join(" ")); tweets[args[0]].push(args.slice(1).join(" "));
await tweets.save(); twitter.tweets = tweets;
await promisify(writeFile)("../tweets.json", JSON.stringify(tweets, null, 2));
return `${message.author.mention}, the content has been added.`; return `${message.author.mention}, the content has been added.`;
}; };

View file

@ -4,28 +4,28 @@ exports.run = async (message, args) => {
if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to enable/disable me!`; if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to enable/disable me!`;
if (args.length === 0) return `${message.author.mention}, you need to provide whether I should be enabled or disabled in this channel!`; if (args.length === 0) return `${message.author.mention}, you need to provide whether I should be enabled or disabled in this channel!`;
if (args[0] !== "disable" && args[0] !== "enable") return `${message.author.mention}, that's not a valid option!`; if (args[0] !== "disable" && args[0] !== "enable") return `${message.author.mention}, that's not a valid option!`;
const guildDB = (await db.guilds.find({id: message.channel.guild.id}).exec())[0]; const guildDB = await db.query("SELECT * FROM guilds WHERE guild_id = $1", [message.channel.guild.id]);
if (args[0].toLowerCase() === "disable") { if (args[0].toLowerCase() === "disable") {
if (args[1] && args[1].match(/^<?[@#]?[&!]?\d+>?$/) && args[1] >= 21154535154122752) { if (args[1] && args[1].match(/^<?[@#]?[&!]?\d+>?$/) && args[1] >= 21154535154122752) {
const id = args[1].replace("@", "").replace("#", "").replace("!", "").replace("&", "").replace("<", "").replace(">", ""); const id = args[1].replace("@", "").replace("#", "").replace("!", "").replace("&", "").replace("<", "").replace(">", "");
if (guildDB.disabledChannels.includes(id)) return `${message.author.mention}, I'm already disabled in this channel!`; if (guildDB.rows[0].disabled.includes(id)) return `${message.author.mention}, I'm already disabled in this channel!`;
guildDB.disabledChannels.push(id); guildDB.rows[0].disabled.push(id);
} else { } else {
if (guildDB.disabledChannels.includes(message.channel.id)) return `${message.author.mention}, I'm already disabled in this channel!`; if (guildDB.rows[0].disabled.includes(message.channel.id)) return `${message.author.mention}, I'm already disabled in this channel!`;
guildDB.disabledChannels.push(message.channel.id); guildDB.rows[0].disabled.push(message.channel.id);
} }
await guildDB.save(); await db.query("UPDATE guilds SET disabled = $1 WHERE guild_id = $2", [guildDB.rows[0].disabled, message.channel.guild.id]);
return `${message.author.mention}, I have been disabled in this channel. To re-enable me, just run \`${guildDB.prefix}channel enable\`.`; return `${message.author.mention}, I have been disabled in this channel. To re-enable me, just run \`${guildDB.rows[0].prefix}channel enable\`.`;
} else if (args[0].toLowerCase() === "enable") { } else if (args[0].toLowerCase() === "enable") {
if (args[1] && args[1].match(/^<?[@#]?[&!]?\d+>?$/) && args[1] >= 21154535154122752) { if (args[1] && args[1].match(/^<?[@#]?[&!]?\d+>?$/) && args[1] >= 21154535154122752) {
const id = args[1].replace("@", "").replace("#", "").replace("!", "").replace("&", "").replace("<", "").replace(">", ""); const id = args[1].replace("@", "").replace("#", "").replace("!", "").replace("&", "").replace("<", "").replace(">", "");
if (!guildDB.disabledChannels.includes(id)) return `${message.author.mention}, I'm not disabled in that channel!`; if (!guildDB.rows[0].disabled.includes(id)) return `${message.author.mention}, I'm not disabled in that channel!`;
guildDB.disabledChannels = guildDB.disabledChannels.filter(item => item !== id); guildDB.rows[0].disabled = guildDB.rows[0].disabled.filter(item => item !== id);
} else { } else {
if (!guildDB.disabledChannels.includes(message.channel.id)) return `${message.author.mention}, I'm not disabled in this channel!`; if (!guildDB.rows[0].disabled.includes(message.channel.id)) return `${message.author.mention}, I'm not disabled in this channel!`;
guildDB.disabledChannels = guildDB.disabledChannels.filter(item => item !== message.channel.id ); guildDB.rows[0].disabled = guildDB.rows[0].disabled.filter(item => item !== message.channel.id );
} }
await guildDB.save(); await db.query("UPDATE guilds SET disabled = $1 WHERE guild_id = $2", [guildDB.rows[0].disabled, message.channel.guild.id]);
return `${message.author.mention}, I have been re-enabled in this channel.`; return `${message.author.mention}, I have been re-enabled in this channel.`;
} }
}; };

View file

@ -5,13 +5,13 @@ const database = require("../utils/database.js");
exports.run = async (message) => { exports.run = async (message) => {
if (!message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`; if (!message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`;
if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`; if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
const counts = (await database.global.findOne({}).lean().exec()).cmdCounts; const counts = await database.query("SELECT * FROM counts");
const countArray = []; const countArray = [];
const sortedValues = Object.entries(counts).sort((a, b) => { const sortedValues = counts.rows.sort((a, b) => {
return b[1] - a[1]; return b.count - a.count;
}); });
for (const [key, value] of sortedValues) { for (const { command, count } of sortedValues) {
countArray.push(`**${key}**: ${value}`); countArray.push(`**${command}**: ${count}`);
} }
const embeds = []; const embeds = [];
const groups = countArray.map((item, index) => { const groups = countArray.map((item, index) => {

View file

@ -6,7 +6,7 @@ const paginator = require("../utils/pagination/pagination.js");
const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional."]; const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional."];
exports.run = async (message, args) => { exports.run = async (message, args) => {
const guild = (await database.guilds.find({ id: message.channel.guild.id }).lean().exec())[0]; const guildDB = await database.query("SELECT * FROM guilds WHERE guild_id = $1", [message.channel.guild.id]);
const commands = collections.commands; const commands = collections.commands;
const aliases = collections.aliases; const aliases = collections.aliases;
if (args.length !== 0 && (commands.has(args[0].toLowerCase()) || aliases.has(args[0].toLowerCase()))) { if (args.length !== 0 && (commands.has(args[0].toLowerCase()) || aliases.has(args[0].toLowerCase()))) {
@ -17,7 +17,7 @@ exports.run = async (message, args) => {
"name": "esmBot Help", "name": "esmBot Help",
"icon_url": client.user.avatarURL "icon_url": client.user.avatarURL
}, },
"title": `${guild.prefix}${aliases.has(args[0].toLowerCase()) ? collections.aliases.get(args[0].toLowerCase()) : args[0].toLowerCase()}`, "title": `${guildDB.rows[0].prefix}${aliases.has(args[0].toLowerCase()) ? collections.aliases.get(args[0].toLowerCase()) : args[0].toLowerCase()}`,
"url": "https://projectlounge.pw/esmBot/help.html", "url": "https://projectlounge.pw/esmBot/help.html",
"description": info.description, "description": info.description,
"color": 16711680, "color": 16711680,
@ -94,7 +94,7 @@ exports.run = async (message, args) => {
}, },
"fields": [{ "fields": [{
"name": "Prefix", "name": "Prefix",
"value": guild.prefix "value": guildDB.rows[0].prefix
}, { }, {
"name": "Tip", "name": "Tip",
"value": misc.random(tips) "value": misc.random(tips)

View file

@ -1,14 +1,14 @@
const database = require("../utils/database.js"); const database = require("../utils/database.js");
exports.run = async (message, args) => { exports.run = async (message, args) => {
const guild = (await database.guilds.find({ id: message.channel.guild.id }).exec())[0]; const guildDB = await database.query("SELECT * FROM guilds WHERE guild_id = $1", [message.channel.guild.id]);
if (args.length !== 0) { if (args.length !== 0) {
if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to change the bot prefix!`; if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to change the bot prefix!`;
guild.set("prefix", args[0]); if (args[0].length > 15) return `${message.author.mention}, that prefix is too long!`;
await guild.save(); await database.query("UPDATE guilds SET prefix = $1 WHERE guild_id = $2", [args[0], message.channel.guild.id]);
return `The prefix has been changed to ${args[0]}.`; return `The prefix has been changed to ${args[0]}.`;
} else { } else {
return `${message.author.mention}, the current prefix is \`${guild.prefix}\`.`; return `${message.author.mention}, the current prefix is \`${guildDB.rows[0].prefix}\`.`;
} }
}; };

View file

@ -5,43 +5,44 @@ const { random } = require("../utils/misc.js");
exports.run = async (message, args) => { exports.run = async (message, args) => {
if (args.length === 0) return `${message.author.mention}, you need to specify the name of the tag you want to view!`; if (args.length === 0) return `${message.author.mention}, you need to specify the name of the tag you want to view!`;
const guild = (await database.guilds.find({ id: message.channel.guild.id }).exec())[0]; const guildDB = await database.query("SELECT * FROM guilds WHERE guild_id = $1", [message.channel.guild.id]);
const tags = guild.tags; const tags = guildDB.rows[0].tags;
const blacklist = ["add", "edit", "remove", "delete", "list", "random"]; const blacklist = ["add", "edit", "remove", "delete", "list", "random"];
switch (args[0].toLowerCase()) { switch (args[0].toLowerCase()) {
case "create":
case "add": case "add":
if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to add!`; if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to add!`;
if (blacklist.includes(args[1].toLowerCase())) return `${message.author.mention}, you can't make a tag with that name!`; if (blacklist.includes(args[1].toLowerCase())) return `${message.author.mention}, you can't make a tag with that name!`;
if (tags.has(args[1].toLowerCase())) return `${message.author.mention}, this tag already exists!`; if (tags[args[1].toLowerCase()]) return `${message.author.mention}, this tag already exists!`;
var result = await setTag(args.slice(2).join(" "), args[1].toLowerCase(), message, guild); var result = await setTag(args.slice(2).join(" "), args[1].toLowerCase(), message, guildDB);
if (result) return result; if (result) return result;
return `${message.author.mention}, the tag \`${args[1].toLowerCase()}\` has been added!`; return `${message.author.mention}, the tag \`${args[1].toLowerCase()}\` has been added!`;
case "delete": case "delete":
case "remove": case "remove":
if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to delete!`; if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to delete!`;
if (!tags.has(args[1].toLowerCase())) return `${message.author.mention}, this tag doesn't exist!`; if (!tags[args[1].toLowerCase()]) return `${message.author.mention}, this tag doesn't exist!`;
if (tags.get(args[1].toLowerCase()).author !== message.author.id && message.author.id !== process.env.OWNER) return `${message.author.mention}, you don't own this tag!`; if (tags[args[1].toLowerCase()].author !== message.author.id && message.author.id !== process.env.OWNER) return `${message.author.mention}, you don't own this tag!`;
tags.set(args[1].toLowerCase(), undefined); delete tags[args[1].toLowerCase()];
await guild.save(); await database.query("UPDATE guilds SET tags = $1 WHERE guild_id = $2", [tags, message.channel.guild.id]);
return `${message.author.mention}, the tag \`${args[1].toLowerCase()}\` has been deleted!`; return `${message.author.mention}, the tag \`${args[1].toLowerCase()}\` has been deleted!`;
case "edit": case "edit":
if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to edit!`; if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to edit!`;
if (!tags.has(args[1].toLowerCase())) return `${message.author.mention}, this tag doesn't exist!`; if (!tags[args[1].toLowerCase()]) return `${message.author.mention}, this tag doesn't exist!`;
if (tags.get(args[1].toLowerCase()).author !== message.author.id && tags.get(args[1].toLowerCase()).author !== process.env.OWNER) return `${message.author.mention}, you don't own this tag!`; if (tags[args[1].toLowerCase()].author !== message.author.id && tags[args[1].toLowerCase()].author !== process.env.OWNER) return `${message.author.mention}, you don't own this tag!`;
await setTag(args.slice(2).join(" "), args[1].toLowerCase(), message, guild); await setTag(args.slice(2).join(" "), args[1].toLowerCase(), message, guildDB);
return `${message.author.mention}, the tag \`${args[1].toLowerCase()}\` has been edited!`; return `${message.author.mention}, the tag \`${args[1].toLowerCase()}\` has been edited!`;
case "own": case "own":
case "owner": case "owner":
if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to check the owner of!`; if (args[1] === undefined) return `${message.author.mention}, you need to provide the name of the tag you want to check the owner of!`;
if (!tags.has(args[1].toLowerCase())) return `${message.author.mention}, this tag doesn't exist!`; if (!tags[args[1].toLowerCase()]) return `${message.author.mention}, this tag doesn't exist!`;
return `${message.author.mention}, this tag is owned by **${client.users.get(tags.get(args[1].toLowerCase()).author).username}#${client.users.get(tags.get(args[1].toLowerCase()).author).discriminator}** (\`${tags.get(args[1].toLowerCase()).author}\`).`; return `${message.author.mention}, this tag is owned by **${client.users.get(tags[args[1].toLowerCase()].author).username}#${client.users.get(tags[args[1].toLowerCase()].author).discriminator}** (\`${tags[args[1].toLowerCase()].author}\`).`;
case "list": case "list":
if (!message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`; if (!message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`;
if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`; if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
var pageSize = 15; var pageSize = 15;
var embeds = []; var embeds = [];
var groups = [...tags.keys()].map((item, index) => { var groups = Object.keys(tags).map((item, index) => {
return index % pageSize === 0 ? [...tags.keys()].slice(index, index + pageSize) : null; return index % pageSize === 0 ? Object.keys(tags).slice(index, index + pageSize) : null;
}).filter((item) => { }).filter((item) => {
return item; return item;
}); });
@ -67,23 +68,21 @@ exports.run = async (message, args) => {
case "random": case "random":
return random([...tags])[1].content; return random([...tags])[1].content;
default: default:
if (!tags.has(args[0].toLowerCase())) return `${message.author.mention}, this tag doesn't exist!`; if (!tags[args[0].toLowerCase()]) return `${message.author.mention}, this tag doesn't exist!`;
return tags.get(args[0].toLowerCase()).content; return tags[args[0].toLowerCase()].content;
} }
}; };
const setTag = async (content, name, message, guild) => { const setTag = async (content, name, message, guildDB) => {
if ((!content || content.length === 0) && message.attachments.length === 0) return `${message.author.mention}, you need to provide the content of the tag!`; if ((!content || content.length === 0) && message.attachments.length === 0) return `${message.author.mention}, you need to provide the content of the tag!`;
if (message.attachments.length !== 0 && content) { if (message.attachments.length !== 0 && content) {
guild.tags.set(name, { content: `${content} ${message.attachments[0].url}`, author: message.author.id }); guildDB.rows[0].tags[name] = { content: `${content} ${message.attachments[0].url}`, author: message.author.id };
await guild.save();
} else if (message.attachments.length !== 0) { } else if (message.attachments.length !== 0) {
guild.tags.set(name, { content: message.attachments[0].url, author: message.author.id }); guildDB.rows[0].tags[name] = { content: message.attachments[0].url, author: message.author.id };
await guild.save();
} else { } else {
guild.tags.set(name, { content: content, author: message.author.id }); guildDB.rows[0].tags[name] = { content: content, author: message.author.id };
await guild.save();
} }
await database.query("UPDATE guilds SET tags = $1 WHERE guild_id = $2", [guildDB.rows[0].tags, message.channel.guild.id]);
return; return;
}; };

View file

@ -7,10 +7,8 @@ exports.run = async (message, args) => {
const memberCheck = message.mentions.length >= 1 ? message.mentions[0] : client.users.get(args[0]); const memberCheck = message.mentions.length >= 1 ? message.mentions[0] : client.users.get(args[0]);
const member = memberCheck ? memberCheck : client.users.get(args[0].replace(/\D/g, "")); const member = memberCheck ? memberCheck : client.users.get(args[0].replace(/\D/g, ""));
if (member) { if (member) {
const guild = (await database.guilds.find({ const guildDB = await database.query("SELECT * FROM guilds WHERE guild_id = $1", [message.channel.guild.id]);
id: message.channel.guild.id const array = guildDB.rows[0].warns[member.id] ? guildDB.rows[0].warns[member.id] : [];
}).exec())[0];
const array = guild.warns.get(member.id) ? guild.warns.get(member.id).warns : [];
if (args[1].toLowerCase() !== "list") { if (args[1].toLowerCase() !== "list") {
args.shift(); args.shift();
array.push({ array.push({
@ -18,11 +16,8 @@ exports.run = async (message, args) => {
time: new Date(), time: new Date(),
creator: message.author.id creator: message.author.id
}); });
guild.warns.set(member.id, { guildDB.rows[0].warns[member.id] = array;
count: (guild.warns.get(member.id) ? guild.warns.get(member.id).count : 0) + 1, await database.query("UPDATE guilds SET warns = $1 WHERE guild_id = $2", [guildDB.rows[0].warns, message.channel.guild.id]);
warns: array
});
await guild.save();
//await message.channel.guild.banMember(member.id, 0, `ban command used by @${message.author.username}#${message.author.discriminator}`); //await message.channel.guild.banMember(member.id, 0, `ban command used by @${message.author.username}#${message.author.discriminator}`);
return `Successfully warned ${member.mention} for \`${args.join(" ")}\`.`; return `Successfully warned ${member.mention} for \`${args.join(" ")}\`.`;
} else { } else {
@ -30,7 +25,8 @@ exports.run = async (message, args) => {
if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`; if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
const warnArray = []; const warnArray = [];
for (const [i, value] of array.entries()) { for (const [i, value] of array.entries()) {
warnArray.push(`**${i + 1}: Added by ${message.channel.guild.members.get(value.creator).username}#${message.channel.guild.members.get(value.creator).discriminator}**: ${value.message} (${value.time.toUTCString()})`); console.log(value);
warnArray.push(`**${i + 1}: Added by ${message.channel.guild.members.get(value.creator).username}#${message.channel.guild.members.get(value.creator).discriminator}**: ${value.message} (${new Date(value.time).toUTCString()})`);
} }
const pageSize = 15; const pageSize = 15;
const embeds = []; const embeds = [];

View file

@ -6,12 +6,5 @@ const client = require("../utils/client.js");
// run when the bot is added to a guild // run when the bot is added to a guild
module.exports = async (guild) => { module.exports = async (guild) => {
logger.log("info", `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot. Owner: ${client.users.get(guild.ownerID).username}#${client.users.get(guild.ownerID).discriminator} (${guild.ownerID})`); logger.log("info", `[GUILD JOIN] ${guild.name} (${guild.id}) added the bot. Owner: ${client.users.get(guild.ownerID).username}#${client.users.get(guild.ownerID).discriminator} (${guild.ownerID})`);
const guildDB = new db.guilds({ await db.query("INSERT INTO guilds (guild_id, tags, prefix, warns, disabled) VALUES ($1, $2, $3, $4, $5)", [guild.id, misc.tagDefaults, "&", {}, []]);
id: guild.id,
tags: misc.tagDefaults,
prefix: "&",
warns: {},
disabledChannels: []
});
await guildDB.save();
}; };

View file

@ -16,9 +16,9 @@ module.exports = async (message) => {
if (!message.channel.guild.members.get(client.user.id).permission.has("sendMessages") || !message.channel.permissionsOf(client.user.id).has("sendMessages")) return; if (!message.channel.guild.members.get(client.user.id).permission.has("sendMessages") || !message.channel.permissionsOf(client.user.id).has("sendMessages")) return;
// prefix can be a mention or a set of special characters // prefix can be a mention or a set of special characters
const guildDB = await database.guilds.findOne({ id: message.channel.guild.id }).lean().exec(); const guildDB = await database.query("SELECT * FROM guilds WHERE guild_id = $1", [message.channel.guild.id]);
const prefixMention = new RegExp(`^<@!?${client.user.id}> `); const prefixMention = new RegExp(`^<@!?${client.user.id}> `);
const prefix = prefixMention.test(message.content) ? message.content.match(prefixMention)[0] : guildDB.prefix; const prefix = prefixMention.test(message.content) ? message.content.match(prefixMention)[0] : guildDB.rows[0].prefix;
// ignore other stuff // ignore other stuff
if (message.content.startsWith(prefix) === false) return; if (message.content.startsWith(prefix) === false) return;
@ -30,7 +30,7 @@ module.exports = async (message) => {
const command = args.shift().toLowerCase(); const command = args.shift().toLowerCase();
// don't run if message is in a disabled channel // don't run if message is in a disabled channel
if (guildDB.disabledChannels && guildDB.disabledChannels.includes(message.channel.id) && command != "channel") return; if (guildDB.rows[0].disabled && guildDB.rows[0].disabled.includes(message.channel.id) && command != "channel") return;
// check if command exists // check if command exists
const cmd = collections.commands.get(command) || collections.commands.get(collections.aliases.get(command)); const cmd = collections.commands.get(command) || collections.commands.get(collections.aliases.get(command));
@ -39,10 +39,8 @@ module.exports = async (message) => {
// actually run the command // actually run the command
logger.log("info", `${message.author.username} (${message.author.id}) ran command ${command}`); logger.log("info", `${message.author.username} (${message.author.id}) ran command ${command}`);
try { try {
const global = (await database.global.findOne({}).exec()); const count = await database.query("SELECT * FROM counts WHERE command = $1", [collections.aliases.has(command) ? collections.aliases.get(command) : command]);
const count = global.cmdCounts.get(collections.aliases.has(command) ? collections.aliases.get(command) : command); await database.query("UPDATE counts SET count = $1 WHERE command = $2", [count.rows[0].count + 1, collections.aliases.has(command) ? collections.aliases.get(command) : command]);
global.cmdCounts.set(collections.aliases.has(command) ? collections.aliases.get(command) : command, parseInt(count) + 1);
await global.save();
const result = await cmd(message, args, content.replace(command, "").trim()); // we also provide the message content as a parameter for cases where we need more accuracy const result = await cmd(message, args, content.replace(command, "").trim()); // we also provide the message content as a parameter for cases where we need more accuracy
if (typeof result === "string" || (typeof result === "object" && result.embed)) { if (typeof result === "string" || (typeof result === "object" && result.embed)) {
await client.createMessage(message.channel.id, result); await client.createMessage(message.channel.id, result);

View file

@ -57,64 +57,41 @@ module.exports = async () => {
// make sure settings/tags exist // make sure settings/tags exist
for (const [id] of client.guilds) { for (const [id] of client.guilds) {
const guildDB = ( const guildDB = await database.query("SELECT * FROM guilds WHERE guild_id = $1", [id]);
await database.guilds if (guildDB.rows.length === 0) {
.findOne({
id: id,
})
.exec()
);
if (!guildDB) {
logger.log(`Registering guild database entry for guild ${id}...`); logger.log(`Registering guild database entry for guild ${id}...`);
const newGuild = new database.guilds({ await database.query("INSERT INTO guilds (guild_id, tags, prefix, warns, disabled) VALUES ($1, $2, $3, $4, $5)", [id, misc.tagDefaults, "&", {}, []]);
id: id,
tags: misc.tagDefaults,
prefix: "&",
warns: {},
disabledChannels: []
});
await newGuild.save();
} else if (guildDB) {
if (!guildDB.warns) {
logger.log(`Creating warn object for guild ${id}...`);
guildDB.set("warns", {});
await guildDB.save();
} else if (!guildDB.disabledChannels) {
logger.log(`Creating disabled channels object for guild ${id}...`);
guildDB.set("disabledChannels", []);
await guildDB.save();
}
} }
} }
const job = new cron.CronJob("0 0 * * 0", async () => { const job = new cron.CronJob("0 0 * * 0", async () => {
logger.log("Deleting stale guild entries in database..."); logger.log("Deleting stale guild entries in database...");
const guildDB = (await database.guilds.find({}).exec()); const guildDB = await database.query("SELECT * FROM guilds");
for (const { id } of guildDB) { for (const { guild_id } of guildDB.rows) {
if (!client.guilds.get(id)) { if (!client.guilds.get(guild_id)) {
await database.guilds.deleteMany({ id: id }); await database.query("DELETE FROM guilds WHERE guild_id = $1", [guild_id]);
logger.log(`Deleted entry for guild ID ${id}.`); logger.log(`Deleted entry for guild ID ${guild_id}.`);
} }
} }
logger.log("Finished deleting stale entries."); logger.log("Finished deleting stale entries.");
}); });
job.start(); job.start();
const global = (await database.global.findOne({}).exec()); let counts;
if (!global) { try {
const countObject = {}; counts = await database.query("SELECT * FROM counts");
for (const command of collections.commands.keys()) { } catch {
countObject[command] = 0; counts = { rows: [] };
}
if (!counts.rows[0]) {
for (const command of collections.commands.keys()) {
await database.query("INSERT INTO counts (command, count) VALUES ($1, $2)", [command, 0]);
} }
const newGlobal = new database.global({
cmdCounts: countObject
});
await newGlobal.save();
} else { } else {
for (const command of collections.commands.keys()) { for (const command of collections.commands.keys()) {
if (!global.cmdCounts.has(command)) { const count = await database.query("SELECT * FROM counts WHERE command = $1", [command]);
global.cmdCounts.set(command, 0); if (!count) {
await global.save(); await database.query("INSERT INTO counts (command, count) VALUES ($1, $2)", [command, 0]);
} }
} }
} }
@ -134,14 +111,7 @@ module.exports = async () => {
if (twitter !== null && twitter.active === false) { if (twitter !== null && twitter.active === false) {
const blocks = await twitter.client.blocks.ids(); const blocks = await twitter.client.blocks.ids();
const tweet = async () => { const tweet = async () => {
const tweets = ( const tweetContent = await misc.getTweet(twitter.tweets);
await database.tweets
.find({
enabled: true,
})
.exec()
)[0];
const tweetContent = await misc.getTweet(tweets);
try { try {
const info = await twitter.client.statuses.update(tweetContent); const info = await twitter.client.statuses.update(tweetContent);
logger.log(`Tweet with id ${info.id_str} has been posted.`); logger.log(`Tweet with id ${info.id_str} has been posted.`);
@ -165,24 +135,11 @@ module.exports = async () => {
tweet.user.screen_name !== "esmBot_" && tweet.user.screen_name !== "esmBot_" &&
!blocks.ids.includes(tweet.user.id_str) !blocks.ids.includes(tweet.user.id_str)
) { ) {
const tweets = (
await database.tweets
.find({
enabled: true,
})
.exec()
)[0];
let tweetContent; let tweetContent;
if ( if (new RegExp(["@this_vid", "@DownloaderBot", "GetVideoBot", "@thisvid_"].join("|")).test(tweet.text)) {
tweet.text.includes("@this_vid") || tweetContent = await misc.getTweet(twitter.tweets, true, true);
tweet.text.includes("@DownloaderBot") ||
tweet.text.includes("@GetVideoBot") ||
tweet.text.includes("@DownloaderB0t") ||
tweet.text.includes("@thisvid_")
) {
tweetContent = await misc.getTweet(tweet, true, true);
} else { } else {
tweetContent = await misc.getTweet(tweets, true).replace(/{{user}}/gm, `@${tweet.user.screen_name}`); tweetContent = await misc.getTweet(twitter.tweets, true).replace(/{{user}}/gm, `@${tweet.user.screen_name}`);
} }
const payload = { const payload = {
status: `@${tweet.user.screen_name} ${tweetContent}`, status: `@${tweet.user.screen_name} ${tweetContent}`,

642
package-lock.json generated
View file

@ -1,6 +1,6 @@
{ {
"name": "esmbot", "name": "esmbot",
"version": "1.3.2", "version": "1.3.3",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -24,6 +24,16 @@
"js-tokens": "^4.0.0" "js-tokens": "^4.0.0"
} }
}, },
"@dabh/diagnostics": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.2.tgz",
"integrity": "sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q==",
"requires": {
"colorspace": "1.1.x",
"enabled": "2.0.x",
"kuler": "^2.0.0"
}
},
"@lavacord/eris": { "@lavacord/eris": {
"version": "0.0.3", "version": "0.0.3",
"resolved": "https://registry.npmjs.org/@lavacord/eris/-/eris-0.0.3.tgz", "resolved": "https://registry.npmjs.org/@lavacord/eris/-/eris-0.0.3.tgz",
@ -59,9 +69,9 @@
"integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM=" "integrity": "sha1-nKUs2jY/aZxpRmwqbM2q2RPqenM="
}, },
"@types/node": { "@types/node": {
"version": "14.0.13", "version": "14.0.20",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.20.tgz",
"integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==" "integrity": "sha512-MRn/NP3dee8yL5QhbSA6riuwkS+UOcsPUMOIOG3KMUQpuor/2TopdRBu8QaaB4fGU+gz/bzyDWt0FtUbeJ8H1A=="
}, },
"acorn": { "acorn": {
"version": "6.4.1", "version": "6.4.1",
@ -123,35 +133,6 @@
"requires": { "requires": {
"delegates": "^1.0.0", "delegates": "^1.0.0",
"readable-stream": "^2.0.6" "readable-stream": "^2.0.6"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
} }
}, },
"argparse": { "argparse": {
@ -180,12 +161,9 @@
"dev": true "dev": true
}, },
"async": { "async": {
"version": "2.6.2", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", "resolved": "https://registry.npmjs.org/async/-/async-3.2.0.tgz",
"integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", "integrity": "sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw=="
"requires": {
"lodash": "^4.17.11"
}
}, },
"async-limiter": { "async-limiter": {
"version": "1.0.1", "version": "1.0.1",
@ -225,49 +203,6 @@
"file-uri-to-path": "1.0.0" "file-uri-to-path": "1.0.0"
} }
}, },
"bl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/bl/-/bl-2.2.0.tgz",
"integrity": "sha512-wbgvOpqopSr7uq6fJrLH8EsvYMJf9gzfo2jCsL2eTy75qXPukA4pCgHamOQkZtY5vmfVtjB+P3LNlMHW5CEZXA==",
"requires": {
"readable-stream": "^2.3.5",
"safe-buffer": "^5.1.1"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
}
},
"bluebird": {
"version": "3.5.1",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz",
"integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA=="
},
"boolbase": { "boolbase": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@ -282,11 +217,6 @@
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
"bson": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.1.4.tgz",
"integrity": "sha512-S/yKGU1syOMzO86+dGpg2qGoDL0zvzcb262G+gqEy6TgP6rt6z6qxSFX/8X6vLC91P7G7C3nLs0+bvDzmvBA3Q=="
},
"buffer": { "buffer": {
"version": "5.4.3", "version": "5.4.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz",
@ -325,6 +255,11 @@
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
}, },
"buffer-writer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz",
"integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw=="
},
"bufferutil": { "bufferutil": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.1.tgz",
@ -443,9 +378,9 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
}, },
"color": { "color": {
"version": "3.0.0", "version": "3.1.2",
"resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz", "resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz",
"integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==", "integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==",
"requires": { "requires": {
"color-convert": "^1.9.1", "color-convert": "^1.9.1",
"color-string": "^1.5.2" "color-string": "^1.5.2"
@ -473,15 +408,10 @@
"simple-swizzle": "^0.2.2" "simple-swizzle": "^0.2.2"
} }
}, },
"colornames": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/colornames/-/colornames-1.1.1.tgz",
"integrity": "sha1-+IiQMGhcfE/54qVZ9Qd+t2qBb5Y="
},
"colors": { "colors": {
"version": "1.3.3", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
}, },
"colorspace": { "colorspace": {
"version": "1.1.2", "version": "1.1.2",
@ -490,6 +420,17 @@
"requires": { "requires": {
"color": "3.0.x", "color": "3.0.x",
"text-hex": "1.0.x" "text-hex": "1.0.x"
},
"dependencies": {
"color": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/color/-/color-3.0.0.tgz",
"integrity": "sha512-jCpd5+s0s0t7p3pHQKpnJ0TpQKKdleP71LWcA0aqiljpiuAkOSUFN/dyH8ZwF0hRmFlrIuRhufds1QyEP9EB+w==",
"requires": {
"color-convert": "^1.9.1",
"color-string": "^1.5.2"
}
}
} }
}, },
"combined-stream": { "combined-stream": {
@ -646,26 +587,11 @@
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
}, },
"denque": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.4.1.tgz",
"integrity": "sha512-OfzPuSZKGcgr96rf1oODnfjqBFmr1DVoc/TrItj3Ohe0Ah1C5WX5Baquw/9U9KovnQ88EqmJbD66rKYUQYN1tQ=="
},
"detect-libc": { "detect-libc": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups="
}, },
"diagnostics": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/diagnostics/-/diagnostics-1.1.1.tgz",
"integrity": "sha512-8wn1PmdunLJ9Tqbx+Fx/ZEuHfJf4NKSN2ZBj7SJC/OWRWha843+WsTjqMe1B5E3p28jqBlp+mJ2fPVxPyNgYKQ==",
"requires": {
"colorspace": "1.1.x",
"enabled": "1.0.x",
"kuler": "1.0.x"
}
},
"dijkstrajs": { "dijkstrajs": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz",
@ -729,12 +655,9 @@
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
}, },
"enabled": { "enabled": {
"version": "1.0.2", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/enabled/-/enabled-1.0.2.tgz", "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz",
"integrity": "sha1-ll9lE9LC0cX0ZStkouM5ZGf8L5M=", "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ=="
"requires": {
"env-variable": "0.0.x"
}
}, },
"end-of-stream": { "end-of-stream": {
"version": "1.4.4", "version": "1.4.4",
@ -749,15 +672,10 @@
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
"integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w=="
}, },
"env-variable": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/env-variable/-/env-variable-0.0.5.tgz",
"integrity": "sha512-zoB603vQReOFvTg5xMl9I1P2PnHsHQQKTEowsKKD7nseUfJq6UWzK+4YtlWUO1nhiQUxe6XMkk+JleSZD1NZFA=="
},
"eris": { "eris": {
"version": "0.11.2", "version": "0.13.3",
"resolved": "https://registry.npmjs.org/eris/-/eris-0.11.2.tgz", "resolved": "https://registry.npmjs.org/eris/-/eris-0.13.3.tgz",
"integrity": "sha512-OhccRcxrPiNUylTamrjIbZM6itKMLjNrwLIXGvNwQZj4CRVOOz9eUVIqOJULB713x1ezw7HoC8AEsnsMNUneDA==", "integrity": "sha512-WBtLyknOWZpYZL9yPhez0oKUWvYpunSg43hGxawwjwSf3gFXmbEPYrT8KlmZXtpJnX16eQ7mzIq+MgSh3LarEg==",
"requires": { "requires": {
"opusscript": "^0.0.7", "opusscript": "^0.0.7",
"tweetnacl": "^1.0.1", "tweetnacl": "^1.0.1",
@ -925,12 +843,6 @@
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true "dev": true
}, },
"eventemitter3": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz",
"integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==",
"optional": true
},
"expand-template": { "expand-template": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
@ -1003,9 +915,9 @@
"dev": true "dev": true
}, },
"fast-safe-stringify": { "fast-safe-stringify": {
"version": "2.0.6", "version": "2.0.7",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
"integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg==" "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
}, },
"fd-slicer": { "fd-slicer": {
"version": "1.1.0", "version": "1.1.0",
@ -1016,9 +928,9 @@
} }
}, },
"fecha": { "fecha": {
"version": "2.3.3", "version": "4.2.0",
"resolved": "https://registry.npmjs.org/fecha/-/fecha-2.3.3.tgz", "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.0.tgz",
"integrity": "sha512-lUGBnIamTAwk4znq5BcqsDaxSmZ9nDVJaij6NvRt/Tg4R69gERA+otPKbS86ROw9nxVMw2/mp1fnaiWqbs6Sdg==" "integrity": "sha512-aN3pcx/DSmtyoovUudctc8+6Hl4T+hI9GBBHLjA76jdZl7+b1sgh5g4k+u/GL3dTy1/pnYzKp69FpJ0OicE3Wg=="
}, },
"figures": { "figures": {
"version": "2.0.0", "version": "2.0.0",
@ -1080,6 +992,11 @@
"integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==",
"dev": true "dev": true
}, },
"fn.name": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
"integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw=="
},
"follow-redirects": { "follow-redirects": {
"version": "1.5.10", "version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
@ -1261,6 +1178,18 @@
"entities": "^1.1.1", "entities": "^1.1.1",
"inherits": "^2.0.1", "inherits": "^2.0.1",
"readable-stream": "^3.1.1" "readable-stream": "^3.1.1"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
}
} }
}, },
"https-proxy-agent": { "https-proxy-agent": {
@ -1397,9 +1326,9 @@
"dev": true "dev": true
}, },
"is-stream": { "is-stream": {
"version": "1.1.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw=="
}, },
"is-typedarray": { "is-typedarray": {
"version": "1.0.0", "version": "1.0.0",
@ -1449,18 +1378,10 @@
"resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.3.1.tgz", "resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.3.1.tgz",
"integrity": "sha512-zCTP6Qd/WwjrpuHFkJuXc5opRdKprUr7eI7+JCCtcetThJt45qptu82MWQ+eET+FtDrMo7+BYjo3iD0XIq1L9Q==" "integrity": "sha512-zCTP6Qd/WwjrpuHFkJuXc5opRdKprUr7eI7+JCCtcetThJt45qptu82MWQ+eET+FtDrMo7+BYjo3iD0XIq1L9Q=="
}, },
"kareem": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.3.1.tgz",
"integrity": "sha512-l3hLhffs9zqoDe8zjmb/mAN4B8VT3L56EUvKNqLFVs9YlFA+zx7ke1DO8STAdDyYNkeSo1nKmjuvQeI12So8Xw=="
},
"kuler": { "kuler": {
"version": "1.0.1", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/kuler/-/kuler-1.0.1.tgz", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
"integrity": "sha512-J9nVUucG1p/skKul6DU3PUZrhs0LPulNaeUOox0IyXDi8S4CztTHs1gQphhuZmzXG7VOQSf6NJfKuzteQLv9gQ==", "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A=="
"requires": {
"colornames": "^1.1.1"
}
}, },
"lavacord": { "lavacord": {
"version": "1.1.9", "version": "1.1.9",
@ -1508,13 +1429,13 @@
"integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=" "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE="
}, },
"logform": { "logform": {
"version": "2.1.2", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/logform/-/logform-2.1.2.tgz", "resolved": "https://registry.npmjs.org/logform/-/logform-2.2.0.tgz",
"integrity": "sha512-+lZh4OpERDBLqjiwDLpAWNQu6KMjnlXH2ByZwCuSqVPJletw0kTWJf5CgSNAUKn1KUkv3m2cUz/LK8zyEy7wzQ==", "integrity": "sha512-N0qPlqfypFx7UHNn4B3lzS/b0uLqt2hmuoa+PpuXNYgozdJYAyauF5Ky0BWVjrxDlMWiT3qN4zPq3vVAfZy7Yg==",
"requires": { "requires": {
"colors": "^1.2.1", "colors": "^1.2.1",
"fast-safe-stringify": "^2.0.4", "fast-safe-stringify": "^2.0.4",
"fecha": "^2.3.3", "fecha": "^4.2.0",
"ms": "^2.1.1", "ms": "^2.1.1",
"triple-beam": "^1.3.0" "triple-beam": "^1.3.0"
} }
@ -1528,12 +1449,6 @@
"yallist": "^2.1.2" "yallist": "^2.1.2"
} }
}, },
"memory-pager": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
"optional": true
},
"mime-db": { "mime-db": {
"version": "1.42.0", "version": "1.42.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz",
@ -1617,9 +1532,9 @@
"integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
}, },
"moment": { "moment": {
"version": "2.26.0", "version": "2.27.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz", "resolved": "https://registry.npmjs.org/moment/-/moment-2.27.0.tgz",
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw==" "integrity": "sha512-al0MUK7cpIcglMv3YF13qSgdAIqxHTO7brRtaz3DlSULbqfazqkc5kEjNrLDOM7fsjshoFIihnU8snrP7zUvhQ=="
}, },
"moment-duration-format": { "moment-duration-format": {
"version": "2.3.2", "version": "2.3.2",
@ -1634,81 +1549,6 @@
"moment": ">= 2.9.0" "moment": ">= 2.9.0"
} }
}, },
"mongodb": {
"version": "3.5.9",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.5.9.tgz",
"integrity": "sha512-vXHBY1CsGYcEPoVWhwgxIBeWqP3dSu9RuRDsoLRPTITrcrgm1f0Ubu1xqF9ozMwv53agmEiZm0YGo+7WL3Nbug==",
"requires": {
"bl": "^2.2.0",
"bson": "^1.1.4",
"denque": "^1.4.1",
"require_optional": "^1.0.1",
"safe-buffer": "^5.1.2",
"saslprep": "^1.0.0"
}
},
"mongoose": {
"version": "5.9.19",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.9.19.tgz",
"integrity": "sha512-wJ5FR2ykvyd17MRHA6sku/N1CMaC/kf4CnN357htD48RpzJhW60YDkxPSPLbkLg8Woa+i7jYi0glhzC0EcBcRQ==",
"requires": {
"bson": "^1.1.4",
"kareem": "2.3.1",
"mongodb": "3.5.9",
"mongoose-legacy-pluralize": "1.0.2",
"mpath": "0.7.0",
"mquery": "3.2.2",
"ms": "2.1.2",
"regexp-clone": "1.0.0",
"safe-buffer": "5.1.2",
"sift": "7.0.1",
"sliced": "1.0.1"
},
"dependencies": {
"ms": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}
}
},
"mongoose-legacy-pluralize": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz",
"integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ=="
},
"mpath": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.7.0.tgz",
"integrity": "sha512-Aiq04hILxhz1L+f7sjGyn7IxYzWm1zLNNXcfhDtx04kZ2Gk7uvFdgZ8ts1cWa/6d0TQmag2yR8zSGZUmp0tFNg=="
},
"mquery": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/mquery/-/mquery-3.2.2.tgz",
"integrity": "sha512-XB52992COp0KP230I3qloVUbkLUxJIu328HBP2t2EsxSFtf4W1HPSOBWOXf1bqxK4Xbb66lfMJ+Bpfd9/yZE1Q==",
"requires": {
"bluebird": "3.5.1",
"debug": "3.1.0",
"regexp-clone": "^1.0.0",
"safe-buffer": "5.1.2",
"sliced": "1.0.1"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
}
}
},
"ms": { "ms": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
@ -1823,9 +1663,12 @@
} }
}, },
"one-time": { "one-time": {
"version": "0.0.4", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/one-time/-/one-time-0.0.4.tgz", "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
"integrity": "sha1-+M33eISCb+Tf+T46nMN7HkSAdC4=" "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
"requires": {
"fn.name": "1.x.x"
}
}, },
"onetime": { "onetime": {
"version": "2.0.1", "version": "2.0.1",
@ -1908,6 +1751,11 @@
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
}, },
"packet-reader": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz",
"integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ=="
},
"parent-module": { "parent-module": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
@ -1957,15 +1805,100 @@
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
}, },
"pg": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-8.3.0.tgz",
"integrity": "sha512-jQPKWHWxbI09s/Z9aUvoTbvGgoj98AU7FDCcQ7kdejupn/TcNpx56v2gaOTzXkzOajmOEJEdi9eTh9cA2RVAjQ==",
"requires": {
"buffer-writer": "2.0.0",
"packet-reader": "1.0.0",
"pg-connection-string": "^2.3.0",
"pg-pool": "^3.2.1",
"pg-protocol": "^1.2.5",
"pg-types": "^2.1.0",
"pgpass": "1.x",
"semver": "4.3.2"
},
"dependencies": {
"semver": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
"integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
}
}
},
"pg-connection-string": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.3.0.tgz",
"integrity": "sha512-ukMTJXLI7/hZIwTW7hGMZJ0Lj0S2XQBCJ4Shv4y1zgQ/vqVea+FLhzywvPj0ujSuofu+yA4MYHGZPTsgjBgJ+w=="
},
"pg-int8": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz",
"integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="
},
"pg-pool": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.2.1.tgz",
"integrity": "sha512-BQDPWUeKenVrMMDN9opfns/kZo4lxmSWhIqo+cSAF7+lfi9ZclQbr9vfnlNaPr8wYF3UYjm5X0yPAhbcgqNOdA=="
},
"pg-protocol": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.2.5.tgz",
"integrity": "sha512-1uYCckkuTfzz/FCefvavRywkowa6M5FohNMF5OjKrqo9PSR8gYc8poVmwwYQaBxhmQdBjhtP514eXy9/Us2xKg=="
},
"pg-types": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz",
"integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==",
"requires": {
"pg-int8": "1.0.1",
"postgres-array": "~2.0.0",
"postgres-bytea": "~1.0.0",
"postgres-date": "~1.0.4",
"postgres-interval": "^1.1.0"
}
},
"pgpass": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz",
"integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=",
"requires": {
"split": "^1.0.0"
}
},
"pngjs": { "pngjs": {
"version": "3.4.0", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz",
"integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==" "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w=="
}, },
"postgres-array": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz",
"integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA=="
},
"postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
},
"postgres-date": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.5.tgz",
"integrity": "sha512-pdau6GRPERdAYUQwkBnGKxEfPyhVZXG/JiS44iZWiNdSOWE09N2lUgN6yshuq6fVSon4Pm0VMXd1srUUkLe9iA=="
},
"postgres-interval": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz",
"integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==",
"requires": {
"xtend": "^4.0.0"
}
},
"prebuild-install": { "prebuild-install": {
"version": "5.3.4", "version": "5.3.5",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.4.tgz", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.5.tgz",
"integrity": "sha512-AkKN+pf4fSEihjapLEEj8n85YIw/tN6BQqkhzbDc0RvEZGdkpJBGMUYx66AAMcPG2KzmPQS7Cm16an4HVBRRMA==", "integrity": "sha512-YmMO7dph9CYKi5IR/BzjOJlRzpxGGVo1EsLSUZ0mt/Mq0HWZIHOKHHcHdT69yG54C9m6i45GpItwRHpk0Py7Uw==",
"requires": { "requires": {
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
"expand-template": "^2.0.3", "expand-template": "^2.0.3",
@ -2115,13 +2048,24 @@
} }
}, },
"readable-stream": { "readable-stream": {
"version": "3.3.0", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.3.0.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-EsI+s3k3XsW+fU8fQACLN59ky34AZ14LoeVZpYwmZvldCFo0r0gnelwF2TcMjLor/BTL5aDJVBMkss0dthToPw==", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"requires": { "requires": {
"inherits": "^2.0.3", "core-util-is": "~1.0.0",
"string_decoder": "^1.1.1", "inherits": "~2.0.3",
"util-deprecate": "^1.0.1" "isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
}
} }
}, },
"readable-web-to-node-stream": { "readable-web-to-node-stream": {
@ -2129,11 +2073,6 @@
"resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz", "resolved": "https://registry.npmjs.org/readable-web-to-node-stream/-/readable-web-to-node-stream-2.0.0.tgz",
"integrity": "sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA==" "integrity": "sha512-+oZJurc4hXpaaqsN68GoZGQAQIA3qr09Or4fqEsargABnbe5Aau8hFn6ISVleT3cpY/0n/8drn7huyyEvTbghA=="
}, },
"regexp-clone": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-1.0.0.tgz",
"integrity": "sha512-TuAasHQNamyyJ2hb97IuBEif4qBHGjPHBS64sZwytpLEqtBQ1gPJTnOaQ6qmpET16cK14kkjbazl6+p0RRv0yw=="
},
"regexpp": { "regexpp": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
@ -2150,22 +2089,6 @@
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
}, },
"require_optional": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz",
"integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==",
"requires": {
"resolve-from": "^2.0.0",
"semver": "^5.1.0"
},
"dependencies": {
"resolve-from": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz",
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
}
}
},
"resolve-from": { "resolve-from": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
@ -2228,15 +2151,6 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true "dev": true
}, },
"saslprep": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
"integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
"optional": true,
"requires": {
"sparse-bitfield": "^3.0.3"
}
},
"semver": { "semver": {
"version": "5.7.0", "version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
@ -2248,9 +2162,8 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
}, },
"sharp": { "sharp": {
"version": "0.25.4", "version": "github:deftomat/sharp#f8ebbc8fb9e9b25b572c517640894869ba25a733",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.25.4.tgz", "from": "github:deftomat/sharp",
"integrity": "sha512-umSzJJ1oBwIOfwFFt/fJ7JgCva9FvrEU2cbbm7u/3hSDZhXvkME8WE5qpaJqLIe2Har5msF5UG4CzYlEg5o3BQ==",
"requires": { "requires": {
"color": "^3.1.2", "color": "^3.1.2",
"detect-libc": "^1.0.3", "detect-libc": "^1.0.3",
@ -2263,15 +2176,6 @@
"tunnel-agent": "^0.6.0" "tunnel-agent": "^0.6.0"
}, },
"dependencies": { "dependencies": {
"color": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/color/-/color-3.1.2.tgz",
"integrity": "sha512-vXTJhHebByxZn3lDvDJYw4lR5+uB3vuoHsuYA5AKuxRVn5wzzIfQKGLBmgdVRHKTJYeK5rvJcHnrd0Li49CFpg==",
"requires": {
"color-convert": "^1.9.1",
"color-string": "^1.5.2"
}
},
"semver": { "semver": {
"version": "7.3.2", "version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
@ -2294,11 +2198,6 @@
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true "dev": true
}, },
"sift": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/sift/-/sift-7.0.1.tgz",
"integrity": "sha512-oqD7PMJ+uO6jV9EQCl0LrRw1OwsiPsiFQR5AR30heR+4Dl7jBBbDLnNvWiak20tzZlSE1H7RB30SX/1j/YYT7g=="
},
"signal-exit": { "signal-exit": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
@ -2353,11 +2252,6 @@
"is-fullwidth-code-point": "^2.0.0" "is-fullwidth-code-point": "^2.0.0"
} }
}, },
"sliced": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz",
"integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E="
},
"sodium-native": { "sodium-native": {
"version": "2.4.6", "version": "2.4.6",
"resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-2.4.6.tgz", "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-2.4.6.tgz",
@ -2383,13 +2277,12 @@
} }
} }
}, },
"sparse-bitfield": { "split": {
"version": "3.0.3", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=", "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"optional": true,
"requires": { "requires": {
"memory-pager": "^1.0.2" "through": "2"
} }
}, },
"sprintf-js": { "sprintf-js": {
@ -2413,9 +2306,9 @@
} }
}, },
"string_decoder": { "string_decoder": {
"version": "1.2.0", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.2.0.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
} }
@ -2547,9 +2440,9 @@
} }
}, },
"tar-stream": { "tar-stream": {
"version": "2.1.2", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.2.tgz", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.3.tgz",
"integrity": "sha512-UaF6FoJ32WqALZGOIAApXx+OdxhekNMChu6axLJR85zMMjXKWFGjbIRe+J6P4UnRGg9rAwWvbTT0oI7hD/Un7Q==", "integrity": "sha512-Z9yri56Dih8IaK8gncVPx4Wqt86NDmQTSh49XLZgjWpGZL9GK9HKParS2scqHCC4w6X9Gh2jwaU45V47XTKwVA==",
"requires": { "requires": {
"bl": "^4.0.1", "bl": "^4.0.1",
"end-of-stream": "^1.4.1", "end-of-stream": "^1.4.1",
@ -2572,16 +2465,6 @@
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
} }
} }
}, },
@ -2593,6 +2476,16 @@
"base64-js": "^1.0.2", "base64-js": "^1.0.2",
"ieee754": "^1.1.4" "ieee754": "^1.1.4"
} }
},
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
} }
} }
}, },
@ -2610,8 +2503,7 @@
"through": { "through": {
"version": "2.3.8", "version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
"dev": true
}, },
"token-types": { "token-types": {
"version": "2.0.0", "version": "2.0.0",
@ -2642,9 +2534,9 @@
} }
}, },
"tweetnacl": { "tweetnacl": {
"version": "1.0.1", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
"integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==", "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==",
"optional": true "optional": true
}, },
"type-check": { "type-check": {
@ -2683,12 +2575,6 @@
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
}, },
"uws": {
"version": "10.148.2",
"resolved": "https://registry.npmjs.org/uws/-/uws-10.148.2.tgz",
"integrity": "sha1-8BZSoLS7lByxi7emJI14D9AVAkU=",
"optional": true
},
"which": { "which": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
@ -2716,57 +2602,40 @@
} }
}, },
"winston": { "winston": {
"version": "3.2.1", "version": "3.3.3",
"resolved": "https://registry.npmjs.org/winston/-/winston-3.2.1.tgz", "resolved": "https://registry.npmjs.org/winston/-/winston-3.3.3.tgz",
"integrity": "sha512-zU6vgnS9dAWCEKg/QYigd6cgMVVNwyTzKs81XZtTFuRwJOcDdBg7AU0mXVyNbs7O5RH2zdv+BdNZUlx7mXPuOw==", "integrity": "sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw==",
"requires": { "requires": {
"async": "^2.6.1", "@dabh/diagnostics": "^2.0.2",
"diagnostics": "^1.1.1", "async": "^3.1.0",
"is-stream": "^1.1.0", "is-stream": "^2.0.0",
"logform": "^2.1.1", "logform": "^2.2.0",
"one-time": "0.0.4", "one-time": "^1.0.0",
"readable-stream": "^3.1.1", "readable-stream": "^3.4.0",
"stack-trace": "0.0.x", "stack-trace": "0.0.x",
"triple-beam": "^1.3.0", "triple-beam": "^1.3.0",
"winston-transport": "^4.3.0" "winston-transport": "^4.4.0"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
}
} }
}, },
"winston-transport": { "winston-transport": {
"version": "4.3.0", "version": "4.4.0",
"resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.3.0.tgz", "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.4.0.tgz",
"integrity": "sha512-B2wPuwUi3vhzn/51Uukcao4dIduEiPOcOt9HJ3QeaXgkJ5Z7UwpBzxS4ZGNHtrxrUvTwemsQiSys0ihOf8Mp1A==", "integrity": "sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw==",
"requires": { "requires": {
"readable-stream": "^2.3.6", "readable-stream": "^2.3.7",
"triple-beam": "^1.2.0" "triple-beam": "^1.2.0"
},
"dependencies": {
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"readable-stream": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"requires": {
"core-util-is": "~1.0.0",
"inherits": "~2.0.3",
"isarray": "~1.0.0",
"process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
}
},
"string_decoder": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": {
"safe-buffer": "~5.1.0"
}
}
} }
}, },
"wordwrap": { "wordwrap": {
@ -2831,9 +2700,14 @@
} }
}, },
"ws": { "ws": {
"version": "7.2.1", "version": "7.3.1",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz",
"integrity": "sha512-sucePNSafamSKoOqoNfBd8V0StlkzJKL2ZAhGQinCfNQ+oacw+Pk7lcdAElecBF2VkLNZRiIb5Oi1Q5lVUVt2A==" "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA=="
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
}, },
"y18n": { "y18n": {
"version": "4.0.0", "version": "4.0.0",

View file

@ -25,22 +25,23 @@
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"duckduckgo-images-api": "github:benpbolton/duckduckgo-images-api", "duckduckgo-images-api": "github:benpbolton/duckduckgo-images-api",
"emoji-regex": "^8.0.0", "emoji-regex": "^8.0.0",
"eris": "^0.11.2", "eris": "^0.13.3",
"file-type": "^13.1.2", "file-type": "^13.1.2",
"gm": "github:TheEssem/gm", "gm": "github:TheEssem/gm",
"jsqr": "^1.3.1", "jsqr": "^1.3.1",
"lavacord": "^1.1.9", "lavacord": "^1.1.9",
"moment": "^2.26.0", "moment": "^2.27.0",
"moment-duration-format": "^2.3.2", "moment-duration-format": "^2.3.2",
"mongoose": "^5.9.19", "node-addon-api": "^3.0.0",
"node-emoji": "^1.10.0", "node-emoji": "^1.10.0",
"node-fetch": "^2.6.0", "node-fetch": "^2.6.0",
"node-tweet": "^0.1.4", "node-tweet": "^0.1.4",
"pg": "^8.3.0",
"puppeteer-core": "^2.1.1", "puppeteer-core": "^2.1.1",
"qrcode": "^1.4.4", "qrcode": "^1.4.4",
"retrotext": "github:TheEssem/retrotext", "retrotext": "github:TheEssem/retrotext",
"sharp": "^0.25.4", "sharp": "github:deftomat/sharp",
"winston": "^3.2.1" "winston": "^3.3.3"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^5.15.2", "eslint": "^5.15.2",
@ -49,9 +50,7 @@
"optionalDependencies": { "optionalDependencies": {
"bufferutil": "^4.0.1", "bufferutil": "^4.0.1",
"erlpack": "github:abalabahaha/erlpack", "erlpack": "github:abalabahaha/erlpack",
"eventemitter3": "^3.1.2",
"sodium-native": "^2.4.6", "sodium-native": "^2.4.6",
"uws": "^10.148.1",
"zlib-sync": "^0.1.6" "zlib-sync": "^0.1.6"
} }
} }

View file

@ -11,12 +11,12 @@ You can invite the bot to your server using this link: https://projectlounge.pw/
A command list can be found [here](https://projectlounge.pw/esmBot/help.html). A command list can be found [here](https://projectlounge.pw/esmBot/help.html).
If you want to run it locally for testing purposes, you should install ImageMagick (version >=7), FFmpeg, MongoDB, and the Microsoft core fonts: If you want to run it locally for testing purposes, you should install ImageMagick (version >=7), FFmpeg, PostgreSQL, and the Microsoft core fonts:
```shell ```shell
# On most Debian/Ubuntu-based distros you will need to build ImageMagick from source instead of installing from apt/similar package managers. # On most Debian/Ubuntu-based distros you will need to build ImageMagick from source instead of installing from apt/similar package managers.
# Instructions to do so can be found here: https://imagemagick.org/script/install-source.php # Instructions to do so can be found here: https://imagemagick.org/script/install-source.php
sudo apt-get install imagemagick ffmpeg mongodb ttf-mscorefonts-installer sudo apt-get install imagemagick ffmpeg postgresql ttf-mscorefonts-installer
``` ```
After that, you should install the rest of the dependencies using npm: After that, you should install the rest of the dependencies using npm:

View file

@ -1,32 +1,9 @@
// database stuff // database stuff
const mongoose = require("mongoose"); const { Pool } = require("pg");
mongoose.connect(process.env.MONGO, { poolSize: 10, bufferMaxEntries: 0, reconnectTries: 5000, useNewUrlParser: true, useUnifiedTopology: true }); const pool = new Pool({
const guildSchema = new mongoose.Schema({ user: "esmbot",
id: String, host: "localhost",
tags: Map, database: "esmbot",
prefix: String, port: 5432
warns: Map,
disabledChannels: [String]
}); });
const Guild = mongoose.model("Guild", guildSchema); module.exports = pool;
const tweetSchema = new mongoose.Schema({
tweets: [String],
replies: [String],
media: [String],
phrases: [String],
games: [String],
characters: [String],
download: [String],
enabled: Boolean
});
const TweetCollection = mongoose.model("TweetCollection", tweetSchema);
const globalSchema = new mongoose.Schema({
cmdCounts: Map
});
const Global = mongoose.model("Global", globalSchema);
exports.guilds = Guild;
exports.tweets = TweetCollection;
exports.global = Global;

View file

@ -1,5 +1,4 @@
const Twitter = require("node-tweet"); const Twitter = require("node-tweet");
const database = require("../utils/database.js");
const client = new Twitter({ const client = new Twitter({
consumerKey: process.env.TWITTER_KEY, consumerKey: process.env.TWITTER_KEY,
consumerSecret: process.env.CONSUMER_SECRET, consumerSecret: process.env.CONSUMER_SECRET,
@ -8,7 +7,4 @@ const client = new Twitter({
}); });
exports.client = client; exports.client = client;
exports.active = false; exports.active = false;
database.tweets.find({ enabled: true }).lean().exec((error, docs) => { exports.tweets = require("../tweets.json");
if (error) throw error;
exports.tweets = docs[0];
});