Skip to content

Commit d6dc512

Browse files
author
alireza.shabani
committed
feat: Add CONTACT message type for sharing contact information in chat
1 parent 7a8369f commit d6dc512

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

docs/events/chat.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
| `id` | string | شناسه‌ی پیام |
77
| `conversation` | [Conversation](#conversation) | مکالمه‌ای که پیام در آن ارسال شده است |
88
| `sender` | [MessageSender](#message-sender) | ارسال‌کننده‌ی پیام |
9-
| `type` | string | نوع پیام: `TEXT`، `IMAGE`، `FILE`، `VOICE`، `LOCATION`، `VIDEO` |
9+
| `type` | string | نوع پیام: `TEXT`، `IMAGE`، `FILE`، `VOICE`، `LOCATION`، `VIDEO`، `CONTACT` |
1010
| `sent_at` | Timestamp (int64) | زمان ارسال پیام |
1111
| `text` | string | متن پیام (در صورتی که نوع پیام `TEXT` باشد) |
1212
| `image_data` | [ImageData](#imagedata) | اطلاعات تصویر (در صورتی که نوع پیام `IMAGE` باشد) |
1313
| `file_data` | [FileData](#filedata) | اطلاعات فایل (در صورتی که نوع پیام `FILE` باشد) |
1414
| `voice_data` | [VoiceData](#voicedata) | اطلاعات صوتی (در صورتی که نوع پیام `VOICE` باشد) |
1515
| `location_data`| [LocationData](#locationdata) | موقعیت مکان (در صورتی که نوع پیام `LOCATION` باشد) |
1616
| `video_data` | [VideoData](#videodata) | اطلاعات ویدئو (در صورتی که نوع پیام `VIDEO` باشد) |
17+
| `contact_data` | [ContactData](#contactdata) | اطلاعات تماس (در صورتی که نوع پیام `CONTACT` باشد) |
1718

1819
#### Text
1920

@@ -197,6 +198,36 @@
197198
"size_bytes": 20971520
198199
}
199200
}
201+
202+
```
203+
#### ContactData
204+
205+
| پارامتر | نوع | توضیحات |
206+
|:-------:|:-------:|----------------------|
207+
| `name` | string (Optional) | نام کاربر (در صورتی که تنظیم کرده باشد، در غیر این صورت خالی) |
208+
| `phone` | string | شماره تلفن تماس |
209+
210+
#### نمونه پیام اطلاعات تماس (Contact)
211+
212+
```json
213+
{
214+
"id": "3edd6da4-d6df-4716-94e1-5836b7a8788b",
215+
"conversation": {
216+
"id": "edbb9499-cccc-4d35-b21f-621fa95f2b3e",
217+
"type": "POST",
218+
"post_token": "gZd7omnS"
219+
},
220+
"sender": {
221+
"side": "SELLER",
222+
"type": "USER"
223+
},
224+
"type": "CONTACT",
225+
"sent_at": 1729430626140000,
226+
"contact_data": {
227+
"name": "Sample Name",
228+
"phone": "+989123456789"
229+
}
230+
}
200231
```
201232

202233

0 commit comments

Comments
 (0)