> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Delete Message

- Component: `appmixer.telegram.core.DeleteMessage`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.telegram 1.1.2](https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.telegram/1.1.2/component/appmixer.telegram.core.DeleteMessage>

Deletes a message from a chat. A bot can delete its own messages for up to 48 hours, and any message in a group only when it has the "Delete messages" admin right. This cannot be undone.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Chat ID (`chatId`) | text | Numeric chat ID (for example _-1002345678901_ for a group or channel) or a public _@channelusername_. The bot must be a member of the chat. Chat IDs are emitted by the New Message trigger. |
| Message ID (`messageId`) | number | ID of the message to delete. By default a bot can delete only its own messages (and incoming messages in private chats), and only for 48 hours after they were sent. To delete messages posted by other members of a group or channel, make the bot an administrator with the _Delete messages_ right — otherwise Telegram answers _message can't be deleted for everyone_. |

## Output ports

### Port `out`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.core.DeleteMessage",
  "label": "Delete Message",
  "description": "Deletes a message from a chat. A bot can delete its own messages for up to 48 hours, and any message in a group only when it has the \"Delete messages\" admin right. This cannot be undone.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:telegram"
  },
  "quota": {
    "manager": "appmixer:telegram",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "chatId": {
            "type": "string"
          },
          "messageId": {
            "type": "integer"
          }
        },
        "required": [
          "chatId",
          "messageId"
        ]
      },
      "inspector": {
        "inputs": {
          "chatId": {
            "type": "text",
            "index": 1,
            "label": "Chat ID",
            "tooltip": "Numeric chat ID (for example <i>-1002345678901</i> for a group or channel) or a public <i>@channelusername</i>. The bot must be a member of the chat. Chat IDs are emitted by the New Message trigger."
          },
          "messageId": {
            "type": "number",
            "index": 2,
            "label": "Message ID",
            "tooltip": "ID of the message to delete. By default a bot can delete only its own messages (and incoming messages in private chats), and only for 48 hours after they were sent. To delete messages posted by other members of a group or channel, make the bot an administrator with the <i>Delete messages</i> right — otherwise Telegram answers <i>message can't be deleted for everyone</i>."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out"
    }
  ],
  "icon": "(data URI omitted)"
}
```
