---
name: "getPanelAgentCurrentChatEmotion"
mode: "kit"
versionRequirements:
  - { name: "@tuya-miniapp/cloud-api", version: "1.0.6" }
---

## getPanelAgentCurrentChatEmotion

> [VERSION] @tuya-miniapp/cloud-api >= 1.0.6

> 💡 接口依赖云能力，需在 [小程序开发者平台](https://platform.tuya.com/miniapp/)开发设置 - 云能力 进行授权配置。

### 方法签名

```typescript
getPanelAgentCurrentChatEmotion(params: GetPanelAgentCurrentChatEmotionParams)
```

### 描述

获取当前聊天心情。

### 参数

`Params`

| 参数 | 类型 | 必填 | 默认值 | 描述 |
| --- | --- | --- | --- | --- |
| `params` | `GetPanelAgentCurrentChatEmotionParams` | 是 | - | 请求体 |

### 返回值

类型: `Promise<GetPanelAgentCurrentChatEmotionResult>`

GetPanelAgentCurrentChatEmotionResult（字段含义见类型定义与 minituya 返回参数）

### 引用对象

##### `interface` GetPanelAgentCurrentChatEmotionParams

| 属性 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `devId` | `string` | 是 | 设备ID |

##### `type` GetPanelAgentCurrentChatEmotionResult

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `emotionOpen` | `boolean` | 是否开启了心情 |
| `emotion` | `string` | 心情 |
| `text` | `string` | 文本 |
| `url` | `string` | 图片链接 |
| `gmtCreate` | `number` | 创建时间 |
| `gmtModified` | `number` | 修改时间 |


### 示例代码

#### 请求示例

```typescript
import { getPanelAgentCurrentChatEmotion } from '@tuya-miniapp/cloud-api';

const params = {
  devId: 'your_device_id',
};

getPanelAgentCurrentChatEmotion(params)
  .then(result => {
    console.log('当前聊天心情:', result);
  })
  .catch(error => {
    console.error('获取聊天心情失败:', error);
  });
```

#### 返回示例

```json
{
  "emotionOpen": true,
  "emotion": "happy",
  "text": "我现在心情很好！",
  "url": "https://example.com/happy_emoji.png",
  "gmtCreate": 1699200000000,
  "gmtModified": 1699200300000
}
```
