Browse Source

React to bot's message instead of answer message

pull/9/head
Abheek Dhawan 4 years ago
parent
commit
85bad6e02b
  1. 42
      bot/awesomescibo.js

42
bot/awesomescibo.js

@ -184,28 +184,30 @@ async function otherCommands(message) {
answerMsg.reply(msgToReply) answerMsg.reply(msgToReply)
); );
} else { } else {
answerMsg.react("<:override:842778128966615060>"); const overrideMsg = answerMsg.channel.send(
answerMsg.channel.send(
`It seems your answer was incorrect. The correct answer was **\`${data.tossup_answer}\`**. Please react with "<:override:842778128966615060>" to override your answer if you think you got it right.` `It seems your answer was incorrect. The correct answer was **\`${data.tossup_answer}\`**. Please react with "<:override:842778128966615060>" to override your answer if you think you got it right.`
); )
const filter = (reaction, user) => { .then(overrideMsg => {
return ( overrideMsg.react("<:override:842778128966615060>");
["override"].includes(reaction.emoji.name) && const filter = (reaction, user) => {
user.id === answerMsg.author.id return (
); ["override"].includes(reaction.emoji.name) &&
}; user.id === answerMsg.author.id
answerMsg
.awaitReactions(filter, {
max: 1,
time: 600000,
errors: ["time"],
})
.then((userReaction) => {
updateScore(true, score, authorId).then((msgToReply) =>
answerMsg.reply(msgToReply)
); );
}); };
} overrideMsg
.awaitReactions(filter, {
max: 1,
time: 600000,
errors: ["time"],
})
.then((userReaction) => {
updateScore(true, score, authorId).then((msgToReply) =>
answerMsg.reply(msgToReply)
);
});
})
}
}) })
.catch(console.error); .catch(console.error);
}); });

Loading…
Cancel
Save