{% hint style="info" %}
This method is planned to be removed by 7.0.0. Use the /chat.delete
endpoint instead.
{% endhint %}
Delete a message by the message id.
Name | Requires Auth | Permission | Setting |
---|---|---|---|
deleteMessage | Yes | delete-message | Message_AllowDeleting - "Allow Message Deleting" |
There are two essential settings to consider when deleting messages.
It is represented as a boolean (true/false), which determines whether message deletion is permitted.
It is represented as an integer and offers more granular control over the deletion functionality. When set to 0
, deletion is allowed without any time restrictions. However, if the value is greater than 0
, there is a time-based restriction where deletion is blocked/disabled after the specified duration has passed.
{% hint style="info" %}
Users with the delete-message
permission can delete any message, while still adhering to the rules set by the Message_AllowDeleting_BlockDeleteInMinutes
setting.
Alternatively, users with the force-delete-message
permission can delete any message without adhering to the rules set by theMessage_AllowDeleting_BlockDeleteInMinutes
setting.
{% endhint %}
Argument | Example | Required | Description |
---|---|---|---|
message_id |
64a1f373376181965ab77f54 |
Required | The room id |
{
"msg": "method",
"method": "deleteMessage",
"id": "42",
"params": [
{ "_id": "8gMsLe9ApZjo2D2iB"}
]
}
{
"msg": "result",
"id": "42"
}