title: discord.js write and read JSON file
body: <p>I have a question. How can I let my DiscordBot write and read a JSON file? I have already programmed something but have only error. Can someone help me out? I would appreciate any help.</p>
  <pre><code>const Discord = require(&quot;discord.js&quot;)
  const botconfig = require(&quot;../botconfig.json&quot;);
  const colours = require(&quot;../colours.json&quot;);
  const superagent = require(&quot;superagent&quot;);
  const { report } = require(&quot;superagent&quot;);
  const usedCommand = new Set();
  
  module.exports.run = async(bot, message, args) =&gt; {
      message.delete();
  
      if (usedCommand.has(message.author.id)) {
          message.reply(&quot;du kannst diesen Command erst in 15 Sekunden wieder verwenden.&quot;).then(msg =&gt; msg.delete({ timeout: &quot;10000&quot; }));
      } else {
          let member = message.mentions.members.first() || message.guild.members.cache.get(args[0])
  
          let reason = args.slice(1).join(&quot; &quot;);
          if (!reason) message.reply(&quot;Bitte gebe einen Beweis in Form von einem Link (Video: Youtube, Bild: prnt.sc) an!&quot;)
  
          var fs = require(&quot;fs&quot;);
          var sampleObject = {
              username: member,
              proof: reason
          };
  
          fs.writeFile('../rpp.json', JSON.stringify(sampleObject, null, 4), (err) =&gt; {
              if (err) {
                  console.error(err);
                  return;
              };
              console.log(&quot;File has been created&quot;);
          });
  
          usedCommand.add(message.author.id);
          setTimeout(() =&gt; {
              usedCommand.delete(message.author.id);
          }, 15000);
      }
  }
  
  module.exports.config = {
      name: &quot;rpp&quot;,
      description: &quot;Bans a user from the guild!&quot;,
      usage: &quot;+ban&quot;,
      accessableby: &quot;Members&quot;,
      aliases: [&quot;proofwrite&quot;]
  }
  </code></pre>
  <p>I want my Discord bot to enter the tagged user and a reason into the JSON file using the &quot;writerrp&quot; command. After that I want the bot to read the data of a user with the &quot;readrrp&quot; command.</p>