const fetch = require('node-fetch');
    const config = require('./config.json');
    const config2 = require('./config2.json');
    function SendMessage(ChannelId, Authtoken, MessageToSend){
        fetch(`https://discord.com/api/v9/channels/${ChannelId}/messages`, {
          "headers": { /* ... */ },
          "body": `{"content":"${MessageToSend}","tts":false}`,
          "method": "POST"
        });
    };
    MessageLoop = async () => {
      for (let i = 0; i < 10; i++) { 
        await new Promise(resolve => {setTimeout(SendMessage, 5000, "1002639672528347206", "x", "iiiiii")
        resolve()
      })
        console.log(i)
      }
    }
    MessageLoop()
I have just started learning js, it is my first language, so bear with me here. Basically, SendMessage is a function that makes a post request with node-fetch. However, when I run this, it waits the 5000 ms, sends the request and then exits out of the program. It doesn't even console.log i or complete the for loop, and I have no idea why.
 
     
    