title: How do I repeat a string?
body: <p>What I am trying to do is repeat this string:</p>
  <pre><code>
                  fs.writeFileSync ('./no.txt', contents, 
                         id.send(read)
                  );
  </code></pre>
  <p>I have tried adding the repeat function</p>
  <pre><code>
                  fs.writeFileSync ('./no.txt', contents, 
                         id.send(read)
                  ).repeat(1);
  </code></pre>
  <p>and what I got from it was this error:
  (node:36840) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'repeat' of undefined</p>
  <p>I am using the latest version of Node. Here's all of my code in case it's needed:</p>
  <pre><code>const Discord = require('discord.js');
  const bot = new Discord.Client();
  const fs = require('fs');
  const prefix = '*';
  
  bot.once('ready', () =&gt; {
      console.log('Hi!')
  })
  bot.on(&quot;message&quot;, async message =&gt; {
     
      let args = message.content.substring(prefix.length).split(&quot; &quot;);
  
          switch(args[0]){
              case 'archive' :
                  
  
                  const contents = `${message.content.slice(8)}\n`; 
  
                  fs.appendFileSync ('./archives.txt', contents,
                     message.channel.send(&quot;Message archived&quot;)
                  );
  
                  const read = fs.readFileSync('./no.txt', {&quot;encoding&quot;: &quot;utf-8&quot;});
                  const id = bot.channels.cache.get('728277105904844840');
  
                  fs.writeFileSync ('./no.txt', contents, 
                         id.send(read)
                  ).repeat(1);
  ;
                  break;
  
                  case 'get' :
                      const thingy = new Discord.MessageAttachment('./archives.txt');
                      message.channel.send(thingy);
                      break;
          }
  })
  </code></pre>