From 94234628afbba4b1b7f6271d268d240bdbcb97f4 Mon Sep 17 00:00:00 2001 From: devlikepro Date: Mon, 18 Nov 2024 17:21:47 +0700 Subject: [PATCH] pin unpin --- content/en/docs/how-to/chats/features.md | 26 +++++++++-------- content/en/docs/how-to/chats/index.md | 37 ++++++++++++++++++++++++ content/en/docs/overview/changelog.md | 6 ++-- 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/content/en/docs/how-to/chats/features.md b/content/en/docs/how-to/chats/features.md index 19fc2c6fe..b8add07fc 100644 --- a/content/en/docs/how-to/chats/features.md +++ b/content/en/docs/how-to/chats/features.md @@ -1,15 +1,17 @@ -| | WEBJS | NOWEB | -|-------------------------------------------------------------------------------------|:-----:|:-----:| -| **Get all chats**
`GET /api/{session}/chats` | ✔️ | ✔️¹ | -| **Unread chat**
`POST /api/{session}/chats/{chatId}/unread` | ✔️ | ✔️¹ | -| **Archive chat**
`POST /api/{session}/chats/{chatId}/archive` | ✔️ | ✔️¹ | -| **Unarchive chat**
`POST /api/{session}/chats/{chatId}/unarchive` | ✔️ | ✔️¹ | -| **Delete chat**
`DELETE /api/{session}/chats/{chatId}` | ✔️ | | -| **Get messages**
`GET /api/{session}/chats/{chatId}/messages` | ✔️ | ✔️¹ | -| **Get message by id**
`GET /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️¹ | -| **Edit message**
`PUT /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | -| **Delete message**
`DELETE /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | -| **Delete all messages**
`DELETE /api/{session}/chats/{chatId}/messages` | ✔️ | | +| | WEBJS | NOWEB | +|----------------------------------------------------------------------------------------|:-----:|:-----:| +| **Get all chats**
`GET /api/{session}/chats` | ✔️ | ✔️¹ | +| **Unread chat**
`POST /api/{session}/chats/{chatId}/unread` | ✔️ | ✔️¹ | +| **Archive chat**
`POST /api/{session}/chats/{chatId}/archive` | ✔️ | ✔️¹ | +| **Unarchive chat**
`POST /api/{session}/chats/{chatId}/unarchive` | ✔️ | ✔️¹ | +| **Delete chat**
`DELETE /api/{session}/chats/{chatId}` | ✔️ | | +| **Get messages**
`GET /api/{session}/chats/{chatId}/messages` | ✔️ | ✔️¹ | +| **Get message by id**
`GET /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️¹ | +| **Pin message**
`POST /api/{session}/chats/{chatId}/messages/{messageId}/pin` | ✔️ | ✔️ | +| **Unpin message**
`POST /api/{session}/chats/{chatId}/messages/{messageId}/unpin` | ✔️ | ✔️ | +| **Edit message**
`PUT /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | +| **Delete message**
`DELETE /api/{session}/chats/{chatId}/messages/{messageId}` | ✔️ | ✔️ | +| **Delete all messages**
`DELETE /api/{session}/chats/{chatId}/messages` | ✔️ | | **** 1. **NOWEB** - you need to [**Enable Store**]({{< relref "/docs/engines/noweb#store" >}}) to get **chats, contacts and messages** diff --git a/content/en/docs/how-to/chats/index.md b/content/en/docs/how-to/chats/index.md index d12d2ffa8..61a25b71c 100644 --- a/content/en/docs/how-to/chats/index.md +++ b/content/en/docs/how-to/chats/index.md @@ -155,6 +155,43 @@ GET /api/{session}/chats/{chatId}/messages/{messageId}?downloadMedia=true - `messageId` - must be in format `{true|false}_213213@c.us_AAAAAAA`) - `downloadMedia` - download media files (images, files) or not +### Pin message + +``` +POST /api/{session}/chats/{chatId}/messages/{messageId}/pin +``` + +Payload: +```json +{ + "duration": 86400 +} +``` + +- 24 hours - `duration=86400` +- 7 days - `duration=604800` +- 30 days - `duration=2592000` + +Response: +```json +{ + "success": true +} +``` + +### Unpin message + +``` +POST /api/{session}/chats/{chatId}/messages/{messageId}/unpin +``` + +Response: +```json +{ + "success": true +} +``` + ### Edit message You can edit **text** messages or **"caption"** in media messages. diff --git a/content/en/docs/overview/changelog.md b/content/en/docs/overview/changelog.md index 4097c3a6e..8cd12c9f7 100644 --- a/content/en/docs/overview/changelog.md +++ b/content/en/docs/overview/changelog.md @@ -32,9 +32,11 @@ Latest Version: ## 2024.11 `2024.11.5` - Add [**📊 Dashboard - Event Monitor**]({{< relref "waha-dashboard#event-monitor" >}}) - observe your events in real-time! -- [**🔄 Webhooks**]({{< relref "webhooks#webhooks" >}}) features in **WAHA Core** version now: Retries, HMAC, Custom Headers! +- All [**🔄 Webhooks**]({{< relref "webhooks#webhooks" >}}) features in **WAHA Core** version now: Retries, HMAC, Custom Headers! - [**🔄 Websockets**]({{< relref "webhooks#websockets" >}}) supports all events now {{< issue 535 >}} -- **NOWEB** - `me.pushName` fix after authentication {{< issue 409 >}} +- [**💬 Chats** - **Pin, Unpin message**]({{< relref "/docs/how-to/chats#pin-message" >}}) {{< issue 613>}} + - **WEBJS**, **NOWEB** +- **NOWEB** - fix `me.pushName` after authentication {{< issue 409 >}} - Add `engine.event` for debug and troubleshooting `2024.11.4`