It seems that OpenAI implementation is correct, I just needed to check the type before accessing .text.
if (message.content[0].type == 'text') {
response = message.content[0].text.value
}
This removes the error.
It seems that OpenAI implementation is correct, I just needed to check the type before accessing .text.
if (message.content[0].type == 'text') {
response = message.content[0].text.value
}
This removes the error.