This commit is contained in:
Dragon Fire
2021-08-02 20:27:07 -04:00
parent 2c3ecd51cd
commit c59c77fbf5
4 changed files with 14 additions and 14 deletions
+7 -7
View File
@@ -42,8 +42,8 @@ module.exports = class AkinatorCommand extends Command {
let wentBack = false;
let forceGuess = false;
const initialRow = new MessageActionRow().addComponents(
new MessageButton().setCustomID('true').setLabel('Ready!').setStyle('PRIMARY'),
new MessageButton().setCustomID('false').setLabel('Nevermind').setStyle('SECONDARY')
new MessageButton().setCustomId('true').setLabel('Ready!').setStyle('PRIMARY'),
new MessageButton().setCustomId('false').setLabel('Nevermind').setStyle('SECONDARY')
);
const gameMsg = await msg.reply('Welcome to Akinator! Think of a character, and I will try to guess it.', {
components: [initialRow]
@@ -75,13 +75,13 @@ module.exports = class AkinatorCommand extends Command {
if (!aki.answers || aki.currentStep >= 79) forceGuess = true;
const row = new MessageActionRow();
for (const answer of aki.answers) {
row.addComponents(new MessageButton().setCustomID(answer).setStyle('PRIMARY').setLabel(answer));
row.addComponents(new MessageButton().setCustomId(answer).setStyle('PRIMARY').setLabel(answer));
}
const sRow = new MessageActionRow();
if (aki.currentStep > 0) {
sRow.addComponents(new MessageButton().setCustomID('back').setStyle('SECONDARY').setLabel('Back'));
sRow.addComponents(new MessageButton().setCustomId('back').setStyle('SECONDARY').setLabel('Back'));
}
sRow.addComponents(new MessageButton().setCustomID('end').setStyle('DANGER').setLabel('End'));
sRow.addComponents(new MessageButton().setCustomId('end').setStyle('DANGER').setLabel('End'));
await buttonPress.editReply(
`**${aki.currentStep + 1}.** ${aki.question} (${Math.round(Number.parseInt(aki.progress, 10))}%)`,
{ components: [row, sRow] }
@@ -124,8 +124,8 @@ module.exports = class AkinatorCommand extends Command {
.setThumbnail(guess.absolute_picture_path || null)
.setFooter(forceGuess ? 'Final Guess' : `Guess ${timesGuessed}`);
const guessRow = new MessageActionRow().addComponents(
new MessageButton().setCustomID('true').setLabel('Yes').setStyle('SUCCESS'),
new MessageButton().setCustomID('false').setLabel('No').setStyle('DANGER')
new MessageButton().setCustomId('true').setLabel('Yes').setStyle('SUCCESS'),
new MessageButton().setCustomId('false').setLabel('No').setStyle('DANGER')
);
await buttonPress.editReply('Is this your character?', { embeds: [embed], components: [guessRow] });
const verification = await gameMsg.awaitMessageComponentInteractions(res => res.user.id === msg.author.id, {
+2 -2
View File
@@ -48,8 +48,8 @@ module.exports = class TrueOrFalseCommand extends Command {
const correct = decodeURIComponent(body.results[0].correct_answer.toLowerCase());
const correctBool = correct === 'true';
const row = new MessageActionRow().addComponents(
new MessageButton().setCustomID('true').setStyle('SUCCESS').setLabel('True'),
new MessageButton().setCustomID('false').setStyle('DANGER').setLabel('False')
new MessageButton().setCustomId('true').setStyle('SUCCESS').setLabel('True'),
new MessageButton().setCustomId('false').setStyle('DANGER').setLabel('False')
);
const questionMsg = await msg.reply(stripIndents`
**You have 15 seconds to answer this question.**
+3 -3
View File
@@ -62,9 +62,9 @@ module.exports = class KinoCommand extends Command {
let end = false;
const row = new MessageActionRow();
row.addComponents(
new MessageButton().setCustomID('prev').setLabel('Prev').setStyle('PRIMARY').setDisabled(true),
new MessageButton().setCustomID('next').setLabel('Next').setStyle('PRIMARY'),
new MessageButton().setCustomID('end').setLabel('End').setStyle('DANGER')
new MessageButton().setCustomId('prev').setLabel('Prev').setStyle('PRIMARY').setDisabled(true),
new MessageButton().setCustomId('next').setLabel('Next').setStyle('PRIMARY'),
new MessageButton().setCustomId('end').setLabel('End').setStyle('DANGER')
);
const initialMsg = await msg.say(stripIndents`
Welcome to Kino's Journey!
+2 -2
View File
@@ -334,8 +334,8 @@ module.exports = class Util {
if (max === 1) return [msg.author.id];
const addS = min - 1 === 1 ? '' : 's';
const row = new MessageActionRow().addComponents(
new MessageButton().setCustomID('join').setLabel('Join Game').setStyle('PRIMARY'),
new MessageButton().setCustomID('start').setLabel('Start Game').setStyle('SUCCESS')
new MessageButton().setCustomId('join').setLabel('Join Game').setStyle('PRIMARY'),
new MessageButton().setCustomId('start').setLabel('Start Game').setStyle('SUCCESS')
);
let text = stripIndents`
You will need at least ${min - 1} more player${addS} (at max ${max - 1}).