I made myself a bot that would simply get an argument from Discord and if the argument had matched it would send the message "Successfully Redeemed." That part works BUT what doesnt work is the exact match. I Want it to exactly match in order for that message to come up but suppose a key is 123456 it would also accept an argument as 12 or 123. I don't want that to happen, it should EXACTLY match. Here is my current code:
if (command === '$redeemkey') {
const fs = require('fs')
fs.readFile('notredeemed.txt', function (err, data) {
if (err) throw err;
if(data.includes(`${args[0]}`)){
console.log("true")
return message.reply({
embeds: [
new MessageEmbed()
.setColor('GREEN')
.setDescription('Redeemed Successfully')
]
})
}
Here is what my notredeemed.txt looks like:
12345678
1234567
123456
12345