en una búsqueda de solicitud siempre encuentro [promesa de objeto] Este es mi código:
async function getStartChat() { const response = await fetch("lib/start_chat.php") let data = await response.text(); return data; } let saveChat = getStartChat(); if(saveChat !== "") qCHAT.innerHTML = saveChat;También probé de esta otra manera:
async function getStartChat() { const response = await fetch("lib/bot.php"). then(response => response.text()). then(data => { return data }). catch(err => console.log(err)); }pero siempre obtengo la misma respuesta
las funciones asíncronas siempre devuelven una promesa.
si desea usar el valor del resultado, debe usar .then
getStartChat().then(saveChat => { if(saveChat !== "") qCHAT.innerHTML = saveChat; });