Disable commands if env vars are missing

This commit is contained in:
Dragon Fire
2024-04-29 01:48:34 -04:00
parent 4bb6d878c5
commit bc850d0626
4 changed files with 45 additions and 1 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ module.exports = class HangmanCommand extends Command {
points++;
}
}
const defined = await this.defineWord(word);
const defined = WEBSTER_KEY ? await this.defineWord(word) : null;
if (word.length === confirmation.length || guessed) {
return msg.say(stripIndents`
You won, it was ${word}!
+1
View File
@@ -52,6 +52,7 @@ module.exports = class XiaoCommand extends Command {
else if (site === 'deviant') result = `Art by <https://www.deviantart.com/${source[2]}>`;
else if (site === 'pixiv') result = `Art Source: <https://www.pixiv.net/en/artworks/${source[2]}>`;
else result = `Art by ${site}`;
if (!SAUCENAO_KEY) return result;
try {
const data = await this.sauceNao(img);
if (data && data[0].similarity > 90) {
+1
View File
@@ -62,6 +62,7 @@ module.exports = class PlayCommand extends Command {
async searchForVideo(query, nsfw) {
if (ytdl.validateURL(query)) return ytdl.getURLVideoID(query);
if (ytdl.validateID(query)) return query;
if (!GOOGLE_KEY) return null;
const { body } = await request
.get('https://www.googleapis.com/youtube/v3/search')
.query({