# Assistants Messages has problem with TypeScript

**URL:** <https://community.openai.com/t/assistants-messages-has-problem-with-typescript/868353>\
**Category:** Feedback\
**Tags:** assistants, assistants-api\
**Created:** [July 16, 2024, 12:45pm UTC](https://community.openai.com/t/assistants-messages-has-problem-with-typescript/868353 "2024-07-16T12:45:38Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![giorgos.ph](https://avatars.discourse-cdn.com/v4/letter/g/a88e4f/32.png) [@giorgos.ph](https://community.openai.com/u/giorgos.ph)\
**Post date:** [July 16, 2024, 1:43pm UTC](https://community.openai.com/t/assistants-messages-has-problem-with-typescript/868353/4 "2024-07-16T13:43:48Z")

</div>

It seems that OpenAI implementation is correct, I just needed to check the type before accessing .text.

```js
if (message.content[0].type == 'text') {
              response = message.content[0].text.value
}

```

This removes the error.

---

_[View the full topic](https://community.openai.com/t/assistants-messages-has-problem-with-typescript/868353)._
