if you use a database, each user has an entire array to themselves, and that means that array can be considered a personal variable, and just pull that from the database, you got a unique variable.
First off, I would not recommend adding someone to your project, but instead, remixing that and giving that to them. Then, instead of having someone do the work for you, I would research a bit on how to store data in a database. And once you know that, you will learn how to do it yourself instead of asking someone else to do it for you.
As they say, give a man a fish, and you feed him for a day. Teach a man to fish, and you feed him for a lifetime.
coding, its ok, he/she is still a beginner and of course, every beginner needs a bit of help when they want to do something they never did before.
anyways… i’m already almost done with helping him
So from what I can see, a person has to send a number and when the person sends check your bot replies with the said number? Correct me if I am wrong.
If thats the case, make use of Collections, Collection is a class that extends the Javasript Built-in Map Object and is used throughout discord.js rather than Arrays for anything that has an ID, for significantly improved performance and ease-of-use.
You create a Collection the same way how you would make a Map: var myCollection = new Discord.Collection();
I prefer to define it like this: client.myCollection = new Discord.Collection();
Your code makes sense but when you define a variable inside a an if statement you cannot call it outside the { }
The collection is just something I think is smart. You should read the hyperlink I attached in the 3rd sentece. Tip: <Collection>.set(message.author.id, "Your turn")
I am sorry to say, however, you’re misguiding him by providing fallacious information, since a variable invoked or created with var can be used outside a block (not a scope), such as if-statements, loops, etc.
For instance, the following code will work just fine
if (true) {
var str = 'test';
}
console.log(str); // 'test'