#Issues with returning
16 messages · Page 1 of 1 (latest)
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
✅Marked as resolved by OP
weatherData will be a promise but by literally doing return response.data
Thats what I thought, but im trying to use it in the bots reply message, and im getting the empty message error
DiscordAPIError[50006]: Cannot send an empty message
Show the code and log weatherData
And im running into the ReferenceError: response is not defined error
Response code
await interaction.reply({content: response.data, ephemeral: showChoice});
const weatherData = axios.get(`API`)
.then(response => {
console.log(response.data);
return response.data
});
- weatherData is a promise, I told you this already. So you need to await after =
- weatherData holds the value of response.data, so use that
which =?
There’s only one that makes logical sense in JavaScript
I see it
Thank youi
I apologize
Im very new to JS
tryna get a feel for it
No worries
Thank you!