> 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).

# Edit Message

- Component: `appmixer.telegram.core.EditMessage`
- 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.EditMessage>

Replaces the text of a message the bot sent earlier. Telegram allows editing a bot message for up to 48 hours after it was sent, and returns the edited message.

## 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 edit. The bot must be its author. |
| Text (`text`) | textarea | The replacement body. Up to 4096 characters. |
| Parse Mode (`parseMode`) | select | How to interpret formatting in the text or caption. |
| Disable Link Preview (`disableWebPagePreview`) | toggle | Do not render a preview card for links contained in the text. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Message ID (`message_id`) | integer | - |
| Thread ID (`message_thread_id`) | integer | - |
| From (`from`) | object | - |
| Chat (`chat`) | object | - |
| Date (Unix Time) (`date`) | integer | - |
| Edit Date (Unix Time) (`edit_date`) | integer | - |
| Text (`text`) | string | - |
| Reply To Message (`reply_to_message`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.core.EditMessage",
  "label": "Edit Message",
  "description": "Replaces the text of a message the bot sent earlier. Telegram allows editing a bot message for up to 48 hours after it was sent, and returns the edited message.",
  "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"
          },
          "text": {
            "type": "string"
          },
          "parseMode": {
            "type": "string"
          },
          "disableWebPagePreview": {
            "type": "boolean"
          }
        },
        "required": [
          "chatId",
          "messageId",
          "text"
        ]
      },
      "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 edit. The bot must be its author."
          },
          "text": {
            "type": "textarea",
            "index": 3,
            "label": "Text",
            "tooltip": "The replacement body. Up to 4096 characters."
          },
          "parseMode": {
            "type": "select",
            "index": 4,
            "label": "Parse Mode",
            "tooltip": "How to interpret formatting in the text or caption.",
            "options": [
              {
                "label": "Plain text",
                "value": ""
              },
              {
                "label": "HTML",
                "value": "HTML"
              },
              {
                "label": "MarkdownV2",
                "value": "MarkdownV2"
              },
              {
                "label": "Markdown (legacy)",
                "value": "Markdown"
              }
            ],
            "defaultValue": ""
          },
          "disableWebPagePreview": {
            "type": "toggle",
            "index": 5,
            "label": "Disable Link Preview",
            "tooltip": "Do not render a preview card for links contained in the text."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "message_id": {
            "type": "integer",
            "title": "Message ID",
            "example": 1042
          },
          "message_thread_id": {
            "type": "integer",
            "title": "Thread ID",
            "example": 12
          },
          "from": {
            "type": "object",
            "title": "From",
            "required": [
              "id",
              "is_bot",
              "first_name"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "title": "From.ID",
                "example": 8865231953
              },
              "is_bot": {
                "type": "boolean",
                "title": "From.Is Bot",
                "example": true
              },
              "first_name": {
                "type": "string",
                "title": "From.First Name",
                "example": "AppmixerTest"
              },
              "last_name": {
                "type": "string",
                "title": "From.Last Name",
                "example": "Novakova"
              },
              "username": {
                "type": "string",
                "title": "From.Username",
                "example": "appmixer_test_bot"
              },
              "language_code": {
                "type": "string",
                "title": "From.Language Code",
                "example": "cs"
              }
            },
            "example": {
              "id": 8865231953,
              "is_bot": true,
              "first_name": "AppmixerTest",
              "username": "appmixer_test_bot"
            }
          },
          "chat": {
            "type": "object",
            "title": "Chat",
            "required": [
              "id",
              "type"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "title": "Chat.ID",
                "example": -1002345678901
              },
              "type": {
                "type": "string",
                "title": "Chat.Type",
                "example": "supergroup"
              },
              "title": {
                "type": "string",
                "title": "Chat.Title",
                "example": "Product Team"
              },
              "username": {
                "type": "string",
                "title": "Chat.Username",
                "example": "product_team"
              },
              "first_name": {
                "type": "string",
                "title": "Chat.First Name",
                "example": "Jana"
              },
              "last_name": {
                "type": "string",
                "title": "Chat.Last Name",
                "example": "Novakova"
              },
              "is_forum": {
                "type": "boolean",
                "title": "Chat.Is Forum",
                "example": false
              },
              "all_members_are_administrators": {
                "type": "boolean",
                "title": "Chat.All Members Are Administrators",
                "example": false
              }
            },
            "example": {
              "id": -1002345678901,
              "type": "supergroup",
              "title": "Product Team"
            }
          },
          "date": {
            "type": "integer",
            "title": "Date (Unix Time)",
            "example": 1756200000
          },
          "edit_date": {
            "type": "integer",
            "title": "Edit Date (Unix Time)",
            "example": 1756200600
          },
          "text": {
            "type": "string",
            "title": "Text",
            "example": "Hello from your workflow!"
          },
          "reply_to_message": {
            "type": "object",
            "title": "Reply To Message",
            "required": [
              "message_id",
              "date",
              "chat"
            ],
            "properties": {
              "message_id": {
                "type": "integer",
                "title": "Reply To Message.ID",
                "example": 1041
              },
              "from": {
                "type": "object",
                "title": "Reply To Message.From",
                "required": [
                  "id",
                  "is_bot",
                  "first_name"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "title": "Reply To Message.From.ID",
                    "example": 6412345678
                  },
                  "is_bot": {
                    "type": "boolean",
                    "title": "Reply To Message.From.Is Bot",
                    "example": false
                  },
                  "first_name": {
                    "type": "string",
                    "title": "Reply To Message.From.First Name",
                    "example": "Jana"
                  },
                  "last_name": {
                    "type": "string",
                    "title": "Reply To Message.From.Last Name",
                    "example": "Novakova"
                  },
                  "username": {
                    "type": "string",
                    "title": "Reply To Message.From.Username",
                    "example": "jana_novakova"
                  },
                  "language_code": {
                    "type": "string",
                    "title": "Reply To Message.From.Language Code",
                    "example": "cs"
                  }
                },
                "example": {
                  "id": 6412345678,
                  "is_bot": false,
                  "first_name": "Jana",
                  "username": "jana_novakova"
                }
              },
              "chat": {
                "type": "object",
                "title": "Reply To Message.Chat",
                "required": [
                  "id",
                  "type"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "title": "Reply To Message.Chat.ID",
                    "example": -1002345678901
                  },
                  "type": {
                    "type": "string",
                    "title": "Reply To Message.Chat.Type",
                    "example": "supergroup"
                  },
                  "title": {
                    "type": "string",
                    "title": "Reply To Message.Chat.Title",
                    "example": "Product Team"
                  },
                  "username": {
                    "type": "string",
                    "title": "Reply To Message.Chat.Username",
                    "example": "product_team"
                  },
                  "first_name": {
                    "type": "string",
                    "title": "Reply To Message.Chat.First Name",
                    "example": "Jana"
                  },
                  "last_name": {
                    "type": "string",
                    "title": "Reply To Message.Chat.Last Name",
                    "example": "Novakova"
                  },
                  "is_forum": {
                    "type": "boolean",
                    "title": "Reply To Message.Chat.Is Forum",
                    "example": false
                  },
                  "all_members_are_administrators": {
                    "type": "boolean",
                    "title": "Reply To Message.Chat.All Members Are Administrators",
                    "example": false
                  }
                },
                "example": {
                  "id": -1002345678901,
                  "type": "supergroup",
                  "title": "Product Team"
                }
              },
              "date": {
                "type": "integer",
                "title": "Reply To Message.Date (Unix Time)",
                "example": 1756199000
              },
              "text": {
                "type": "string",
                "title": "Reply To Message.Text",
                "example": "What is the status?"
              }
            },
            "example": {
              "message_id": 1041,
              "date": 1756199000,
              "text": "What is the status?"
            }
          }
        },
        "required": [
          "message_id",
          "date",
          "chat",
          "edit_date"
        ]
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
