This commit is contained in:
Dragon Fire
2021-08-02 20:26:18 -04:00
parent 0ba5f71e06
commit 2c3ecd51cd
4 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -56,7 +56,7 @@ module.exports = class AkinatorCommand extends Command {
return gameMsg.edit('Guess you didn\'t want to play after all...', { components: [] }); return gameMsg.edit('Guess you didn\'t want to play after all...', { components: [] });
} }
let buttonPress = initialVerify.first(); let buttonPress = initialVerify.first();
if (buttonPress.customID === 'false') return buttonPress.update('Too bad...', { components: [] }); if (buttonPress.customId === 'false') return buttonPress.update('Too bad...', { components: [] });
await this.sendLoadingMessage(buttonPress, [initialRow]); await this.sendLoadingMessage(buttonPress, [initialRow]);
const guessBlacklist = []; const guessBlacklist = [];
while (timesGuessed < 3) { while (timesGuessed < 3) {
@@ -96,7 +96,7 @@ module.exports = class AkinatorCommand extends Command {
} }
buttonPress = interactions.first(); buttonPress = interactions.first();
await this.sendLoadingMessage(buttonPress, [row, sRow]); await this.sendLoadingMessage(buttonPress, [row, sRow]);
const choice = interactions.first().customID; const choice = interactions.first().customId;
if (choice === 'end') { if (choice === 'end') {
forceGuess = true; forceGuess = true;
} else if (choice === 'back') { } else if (choice === 'back') {
@@ -138,7 +138,7 @@ module.exports = class AkinatorCommand extends Command {
} }
buttonPress = verification.first(); buttonPress = verification.first();
await this.sendLoadingMessage(buttonPress, [guessRow]); await this.sendLoadingMessage(buttonPress, [guessRow]);
if (buttonPress.customID === 'true') { if (buttonPress.customId === 'true') {
win = false; win = false;
break; break;
} else if (timesGuessed >= 3 || forceGuess) { } else if (timesGuessed >= 3 || forceGuess) {
+1 -1
View File
@@ -62,7 +62,7 @@ module.exports = class TrueOrFalseCommand extends Command {
}); });
if (!interactions.size) return questionMsg.edit(`Sorry, time is up! It was ${correctBool}.`, { components: [] }); if (!interactions.size) return questionMsg.edit(`Sorry, time is up! It was ${correctBool}.`, { components: [] });
const ans = interactions.first(); const ans = interactions.first();
const ansBool = ans.customID === 'true'; const ansBool = ans.customId === 'true';
if (correctBool !== ansBool) return ans.update(`Nope, sorry, it's ${correctBool}.`, { components: [] }); if (correctBool !== ansBool) return ans.update(`Nope, sorry, it's ${correctBool}.`, { components: [] });
return ans.update('Nice job! 10/10! You deserve some cake!', { components: [] }); return ans.update('Nice job! 10/10! You deserve some cake!', { components: [] });
} }
+4 -4
View File
@@ -78,7 +78,7 @@ module.exports = class KinoCommand extends Command {
}); });
if (!initialInteractions.size) return initialMsg.edit('Maybe next time!', { components: [] }); if (!initialInteractions.size) return initialMsg.edit('Maybe next time!', { components: [] });
let choice = initialInteractions.first(); let choice = initialInteractions.first();
if (choice.customID === 'end') return choice.update('Maybe next time!', { components: [] }); if (choice.customId === 'end') return choice.update('Maybe next time!', { components: [] });
while (!end) { while (!end) {
if (i === 0) { if (i === 0) {
row.components[0].setDisabled(true); row.components[0].setDisabled(true);
@@ -101,11 +101,11 @@ module.exports = class KinoCommand extends Command {
}); });
if (!interactions.size) break; if (!interactions.size) break;
choice = interactions.first(); choice = interactions.first();
if (choice.customID === 'next') { if (choice.customId === 'next') {
i++; i++;
} else if (choice.customID === 'prev') { } else if (choice.customId === 'prev') {
i--; i--;
} else if (choice.customID === 'end') { } else if (choice.customId === 'end') {
break; break;
} else { } else {
return initialMsg.edit('Maybe next time!', { components: [] }); return initialMsg.edit('Maybe next time!', { components: [] });
+2 -2
View File
@@ -348,7 +348,7 @@ module.exports = class Util {
const filter = interaction => { const filter = interaction => {
if (interaction.user.bot) return false; if (interaction.user.bot) return false;
if (blacklist.includes(interaction.user.id)) return false; if (blacklist.includes(interaction.user.id)) return false;
if (interaction.user.id !== msg.author.id && interaction.customID === 'start') return false; if (interaction.user.id !== msg.author.id && interaction.customId === 'start') return false;
if (joined.includes(interaction.user.id)) return false; if (joined.includes(interaction.user.id)) return false;
return true; return true;
}; };
@@ -358,7 +358,7 @@ module.exports = class Util {
time: 120000 time: 120000
}); });
collector.on('collect', interaction => { collector.on('collect', interaction => {
if (interaction.customID === 'start') { if (interaction.customId === 'start') {
interaction.deferUpdate(); interaction.deferUpdate();
collector.stop(); collector.stop();
return; return;