Allow case wrong in typing

This commit is contained in:
Dragon Fire
2021-01-31 12:38:17 -05:00
parent 169e116026
commit 4773f651ca
2 changed files with 6 additions and 3 deletions
+4 -1
View File
@@ -39,7 +39,10 @@ module.exports = class TypingRaceCommand extends Command {
files: [{ attachment: img, name: 'typing-race.png' }]
});
const now = Date.now();
const filter = res => [opponent.id, msg.author.id].includes(res.author.id) && res.content === sentence;
const filter = res => {
if (![opponent.id, msg.author.id].includes(res.author.id)) return false;
return res.content.toLowerCase() === sentence;
};
const winner = await msg.channel.awaitMessages(filter, {
max: 1,
time: 30000