Thank you for your reply, I have follow your steps here is my code below i will be removing the webhook link,
import {fetch} from 'wix-fetch';
export function Books_afterInsert(item, context) {
let data = {
content: item.bookName,
context: item.coverArt //sends only the values of the title field
}
sendDiscord(data);
}
function sendDiscord(data) {
const response = fetch("MY DISCORD URL HERE", {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
});
}
This works ye thank you, when it comes to adding the url of the booke and an image ive found that my placement is wrong i was seeing that it should be in the JSON body to create aan embed but when I add that information in (I know it in javaScript) wix code its not the same how to do it in java below)
function sendDiscord(data) {
const response = fetch("MY DISCORD URL HERE", {
method: 'POST',
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data) {
.setColor([hexcolor here])
.setTitle("Book Title here")
.setImage("User Icon url")
.setDiscription("Book description")
}
});
}
this style seems not to work