mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 21:44:48 +02:00
Disable commands if env vars are missing
This commit is contained in:
@@ -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}!
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user