Problems for JSON file

Hello, I have a problem … I have a bot Discord, with a system of money and XP, so I have 2 file .JSON but when I win for example 2 corners, my bot will record that I have 2 more corners, but will not write it in his .JSON file, it will write that when I will restart it … And if I do the command to know how many corners I have before restarting, he will not tell me that I got 2 more …
Please, help me!
Sincerely Black Shadow

Hi, I think these answers will help a little.