Guest User

Untitled

a guest
Jan 22nd, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. const user = message.guild.members.get(message.mentions.users.first().id);
  2. const file = (user.id + ".json");
  3. const content = {
  4. "name": user.username,
  5. "isFlagged": false,
  6. "punishments": 1,
  7. "id": user.id,
  8. "discrim": user.discriminator
  9. };
  10. var B = content.toString();
  11. fs.writeFileIfNotExist(file, B, function(err, existed) {
  12. if (err) {
  13. console.log(err)
  14. } else {
  15. console.log('file created sucessfuly!')
  16. }
  17. });
  18. let points = JSON.parse(fs.readFileSync('./' + user.id + '.json'));
  19. points.isFlagged = false;
  20. points.punishments = points.punishments + 1;
Add Comment
Please, Sign In to add comment