As the title states, I am trying to post messages to a Slack chat. I had code that work with fetch but I cannot seem to find it now. Below is my current code:
fetch('http://slack.com/api/chat.postMessage', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'token': 'REMOVED TOKEN',
'channel': 'bot',
'text': 'This is a test.'
}
});
The program is never sending a message now, no matter what I change or add to the code. I want to get this done with vanilla JS, I do not want to use a framework.
I hope my question is clear, if not, please let me know.