Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const user = message.guild.members.get(message.mentions.users.first().id);
- const file = (user.id + ".json");
- const content = {
- "name": user.username,
- "isFlagged": false,
- "punishments": 1,
- "id": user.id,
- "discrim": user.discriminator
- };
- var B = content.toString();
- fs.writeFileIfNotExist(file, B, function(err, existed) {
- if (err) {
- console.log(err)
- } else {
- console.log('file created sucessfuly!')
- }
- });
- let points = JSON.parse(fs.readFileSync('./' + user.id + '.json'));
- points.isFlagged = false;
- points.punishments = points.punishments + 1;
Add Comment
Please, Sign In to add comment