Skip to main content

Editing Messages & Pinning Messages

Edit Message

Note: Only text messages can be modified.

Endpoint

ItemDescription
URLhttps://api-tx.typex-test.cn/open/robot/message/edit
MethodPOST
Content-Typeapplication/json

Request Headers

Authorization: Bearer <bot_token>
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
chat_idstringYesConversation ID
message_idstringYesMessage ID to edit
content.textstringYesModified text content
content.is_markdownboolNoWhether to use Markdown format

Example: Edit as Plain Text

curl --location 'https://api-tx.typex-test.cn/open/robot/message/edit' \
--header 'Authorization: Bearer <bot_token>' \
--header 'Content-Type: application/json' \
--data '{
"chat_id": "7602566729281049630",
"content": {
"text": "<p>Modified text content</p>"
},
"message_id": "7626681351445415938"
}'

Example: Edit as Markdown

curl --location 'https://api-tx.typex-test.cn/open/robot/message/edit' \
--header 'Authorization: Bearer <bot_token>' \
--header 'Content-Type: application/json' \
--data '{
"chat_id": "7602566729281049630",
"content": {
"is_markdown": true,
"text": "**Bold text** normal text"
},
"message_id": "7626681351445415938"
}'

Pin Message

Pin important messages or unpin them in group chats.

Endpoint

ItemDescription
URLhttps://api-coco.typex.im/open/robot/message/pin
MethodPOST
Content-Typeapplication/json

Request Headers

Authorization: Bearer <bot_token>
Content-Type: application/json

Request Parameters

ParameterTypeRequiredDescription
chat_idstringYesConversation ID
is_pinboolYestrue-pin, false-unpin
msg_idsstring[]YesMessage ID array. Pin supports one at a time; unpin supports batch
is_notifyboolYesWhether to notify all group members

Response Format

{
"code": 0,
"msg": "ok",
"data": null
}