title: Google Scripts message to discord. How to make it more efficient
body: <p>I've got this code to send the message, but I know that there has to be a more efficient way to do so, rather than a new message for every section.  Trying it that way is overloading the webhook and causing me to be rate limited.</p>
  <p>I've edited to include the full code, minus the webhook URLs.  I'm fairly new to coding, so I'm sure it's a mess, but I know it was at least working up to a point because I was testing as I went.  It's mainly the sending back part that isn't working how I intended.</p>
  <pre><code>function Insert_Checks() {
    const ss = SpreadsheetApp.getActiveSpreadsheet()
    var ws = ss.getActiveSheet()
    var range = ws.getRange(2,2,ws.getLastRow() - 1)
    var rangec = range.offset(0,1)
    rangec.insertCheckboxes()
  }
  function Supply_Order_Complete() {
      const ss = SpreadsheetApp.getActiveSpreadsheet()
      var ws = ss.getActiveSheet()
      var range = ws.getRange(2,1,ws.getLastRow())
      num_rows = Logger.log(range.getNumRows())
      const rows = ws.getDataRange().getValues()
      var headers = rows.shift();
      var ordered = []
      var subs = []
      var notes = []
  
      rows.forEach(function(row) {
        i = 0
        if(row[2] || row[4] != &quot;&quot;) {
          ordered.push(row[1].getValue)
          subs.push(row[3].getValue)
          notes.push(row[4].getValue)
        }
        while (i &lt;= ordered.length) {
          var currentMessage = []
          currentMessage.push(&quot;'ordered[i]' - 'subs[i]' - 'notes[i]'\n&quot;)
          i = i + 1
      }
      Send_Order(currentMessage)
      });
  }
  function Send_Order(currentMessage) {
    const ss = SpreadsheetApp.getActiveSpreadsheet()
    var ws = ss.getActiveSheet()
    var wsn = ws.getName()
    if (wsn === &quot;9th&quot;) {
      url = 
    }
    if (wsn === &quot;Apartments&quot;) {
      url = 
    }
    if (wsn === &quot;Billings&quot;) {
      url = 
    }
    if (wsn === &quot;ElmA&quot;) {
      url = 
    }
    if (wsn === &quot;ElmB&quot;) {
      url = 
    }
    if (wsn === &quot;Knollview&quot;) {
      url = 
    }
    if (wsn === &quot;Centennial&quot;) {
      url = '
    }
    if (wsn === &quot;Michigan&quot;) {
      url = 
    }
    if (wsn === &quot;Scammon&quot;) {
      url = 
    }
    if (wsn === &quot;Adams&quot;) {
      url = 
    }
    if (wsn === &quot;Test&quot;) {
      url = 
    }
    const message = {
      content: currentMessage
    }
    const options = {
      'method' : 'post',
      'payload' : message
    }
    const res = UrlFetchApp.fetch(url,options)
  }```
  
  What I am getting on Discord is this: 
  [Ljava.lang.Object;@2eced131
  [Ljava.lang.Object;@5b8e5a90
  [Ljava.lang.Object;@1b09921c
  [Ljava.lang.Object;@4037c438
  [Ljava.lang.Object;@24727d3e
  
  Each one being a separate message rather than one message.
  [![enter image description here][1]][1]
  
  
    [1]: https://i.stack.imgur.com/FmWJH.png
  </code></pre>