Reputation: 41
The data is the same in all the servers (for example if I'm print the amount of coins in my server, and then in other server that the bot in it shows the same amount because the data is the same), how to do it per server? (new coins data for every other server). (I created a coins.json file that saves the user ID and his amount of coins and command in the main (index.js) that adds coins to the user amount of coins in the JSON file).
Upvotes: 0
Views: 79
Reputation: 151
Add the guild ID with the player ID into the JSON file and then when you call the player from the code, add a check to make sure that the guild the command was executed in (<message>.guild.id
) is the same as the one in the database.
I would also recommend switching from JSON to MongoDB. In the past, my JSON files have corrupted multiple times.
Upvotes: 1