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

# New Message

- Component: `appmixer.telegram.core.NewMessage`
- Kind: Trigger
- 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.NewMessage>

Triggers when the bot receives a message. Telegram allows only one webhook per bot, so every Telegram trigger of the same bot shares one registration created on flow start; stopping a flow leaves it in place because sibling flows may still need it. In groups the bot only sees messages addressed to it unless privacy mode is turned off in @BotFather.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Chat ID (`chatId`) | text | Only emit messages from this chat. Leave empty to receive messages from every chat the bot is in. Numeric ID or @channelusername. Mind the bot's default **privacy mode**: in groups the bot receives only commands, replies to its own messages and messages that @-mention it. To get every group message, send _/setprivacy_ to @BotFather and choose Disable (re-add the bot to the group afterwards). |
| Include Edited Messages (`includeEdited`) | toggle | Also fire when an existing message is edited. |
| Include Channel Posts (`includeChannelPosts`) | toggle | Also fire for posts published in channels the bot administers. |

## 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 | - |
| Caption (`caption`) | string | - |
| Photo Sizes (`photo`) | array | - |
| Document (`document`) | object | - |
| Reply To Message (`reply_to_message`) | object | - |
| Update ID (`update_id`) | integer | - |
| Update Kind (`update_kind`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.telegram.core.NewMessage",
  "label": "New Message",
  "description": "Triggers when the bot receives a message. Telegram allows only one webhook per bot, so every Telegram trigger of the same bot shares one registration created on flow start; stopping a flow leaves it in place because sibling flows may still need it. In groups the bot only sees messages addressed to it unless privacy mode is turned off in @BotFather.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "trigger": true,
  "webhook": true,
  "auth": {
    "service": "appmixer:telegram"
  },
  "quota": {
    "manager": "appmixer:telegram",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "properties": {
    "schema": {
      "type": "object",
      "properties": {
        "chatId": {
          "type": "string"
        },
        "includeEdited": {
          "type": "boolean"
        },
        "includeChannelPosts": {
          "type": "boolean"
        }
      }
    },
    "inspector": {
      "inputs": {
        "chatId": {
          "type": "text",
          "index": 1,
          "label": "Chat ID",
          "tooltip": "Only emit messages from this chat. Leave empty to receive messages from every chat the bot is in. Numeric ID or @channelusername. Mind the bot's default <b>privacy mode</b>: in groups the bot receives only commands, replies to its own messages and messages that @-mention it. To get every group message, send <i>/setprivacy</i> to @BotFather and choose Disable (re-add the bot to the group afterwards)."
        },
        "includeEdited": {
          "type": "toggle",
          "index": 2,
          "label": "Include Edited Messages",
          "tooltip": "Also fire when an existing message is edited."
        },
        "includeChannelPosts": {
          "type": "toggle",
          "index": 3,
          "label": "Include Channel Posts",
          "tooltip": "Also fire for posts published in channels the bot administers."
        }
      }
    }
  },
  "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": 6412345678
              },
              "is_bot": {
                "type": "boolean",
                "title": "From.Is Bot",
                "example": false
              },
              "first_name": {
                "type": "string",
                "title": "From.First Name",
                "example": "Jana"
              },
              "last_name": {
                "type": "string",
                "title": "From.Last Name",
                "example": "Novakova"
              },
              "username": {
                "type": "string",
                "title": "From.Username",
                "example": "jana_novakova"
              },
              "language_code": {
                "type": "string",
                "title": "From.Language Code",
                "example": "cs"
              }
            },
            "example": {
              "id": 6412345678,
              "is_bot": false,
              "first_name": "Jana",
              "username": "jana_novakova"
            }
          },
          "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!"
          },
          "caption": {
            "type": "string",
            "title": "Caption",
            "example": "Quarterly report"
          },
          "photo": {
            "type": "array",
            "title": "Photo Sizes",
            "items": {
              "type": "object",
              "required": [
                "file_id",
                "file_unique_id",
                "width",
                "height"
              ],
              "properties": {
                "file_id": {
                  "type": "string",
                  "title": "File ID"
                },
                "file_unique_id": {
                  "type": "string",
                  "title": "File Unique ID"
                },
                "width": {
                  "type": "integer",
                  "title": "Width"
                },
                "height": {
                  "type": "integer",
                  "title": "Height"
                },
                "file_size": {
                  "type": "integer",
                  "title": "File Size"
                }
              }
            },
            "example": [
              {
                "file_id": "AgACAgIAAxkBAAIB",
                "file_unique_id": "AQADr8gxG9c",
                "width": 1280,
                "height": 720,
                "file_size": 84213
              }
            ]
          },
          "document": {
            "type": "object",
            "title": "Document",
            "required": [
              "file_id",
              "file_unique_id"
            ],
            "properties": {
              "file_id": {
                "type": "string",
                "title": "Document.File ID"
              },
              "file_unique_id": {
                "type": "string",
                "title": "Document.File Unique ID"
              },
              "file_name": {
                "type": "string",
                "title": "Document.File Name"
              },
              "mime_type": {
                "type": "string",
                "title": "Document.MIME Type"
              },
              "file_size": {
                "type": "integer",
                "title": "Document.File Size"
              }
            },
            "example": {
              "file_id": "BQACAgIAAxkBAAIB",
              "file_unique_id": "AgADr8gxG9c",
              "file_name": "report.pdf",
              "mime_type": "application/pdf",
              "file_size": 24518
            }
          },
          "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?"
            }
          },
          "update_id": {
            "type": "integer",
            "title": "Update ID",
            "example": 987654321
          },
          "update_kind": {
            "type": "string",
            "title": "Update Kind",
            "example": "message"
          }
        },
        "required": [
          "message_id",
          "date",
          "chat",
          "update_id",
          "update_kind"
        ]
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
