Hey @oskarcodes ! My code doesn't work. Can you please check why?
function sendMessage() { const request = new XMLHttpRequest(); request.open("POST", "https://discordapp.com/api/webhooks/676118118082281513/ZS5YcWhurzokBrKX9NgexqtxrJA5Pu2Bo4i7_JsIxC-JIbPBVhSZkcVVukGOro52rnQA"); request.setRequestHeader('Content-type', 'application/json'); const params = { username: "My Webhook Name", avatar_url: "", content: "The message to send" } request.send(JSON.stringify(params)); }
Thank you!
Your code looks fine, it must be the Webhook URL endpoint that is wrong
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey @oskarcodes ! My code doesn't work. Can you please check why?
Thank you!
Your code looks fine, it must be the Webhook URL endpoint that is wrong