Made youtube use searx for results, fall back to dummy db when none is specified, added cluster to stats, more QOL changes

This commit is contained in:
TheEssem 2021-06-26 15:56:02 -05:00
parent b7a847b612
commit 4cdd59dfcd
No known key found for this signature in database
GPG key ID: A3F9F02129092FCA
8 changed files with 19 additions and 20 deletions

View file

@ -1,3 +1,3 @@
// wrapper for the database drivers in ./database/
module.exports = require(`./database/${process.env.DB.split("://")[0]}.js`);
module.exports = require(`./database/${process.env.DB ? process.env.DB.split("://")[0] : "dummy"}.js`);

View file

@ -1,5 +1,8 @@
// dummy (no-op) database handler
const misc = require("../misc.js");
const logger = require("../logger.js");
logger.warn("Using dummy database adapter. If this isn't what you wanted, check your DB variable.");
exports.setup = async () => {};
exports.stop = async () => {};

View file

@ -4,8 +4,6 @@ const logger = require("./logger.js");
// load command into memory
exports.load = async (command, soundStatus) => {
const props = require(`../${command}`);
if (props.requires.includes("google") && process.env.GOOGLE === "") return logger.log("warn", `Google info not provided in config, skipped loading command ${command}...`);
if (props.requires.includes("cat") && process.env.CAT === "") return logger.log("warn", `Cat API info not provided in config, skipped loading command ${command}...`);
if (props.requires.includes("mashape") && process.env.MASHAPE === "") return logger.log("warn", `Mashape/RapidAPI info not provided in config, skipped loading command ${command}...`);
if (props.requires.includes("sound") && soundStatus) return logger.log("warn", `Failed to connect to some Lavalink nodes, skipped loading command ${command}...`);
const commandArray = command.split("/");