> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# On channel message posted

> Start an automation from root messages and replies in one Teams channel.

`onChannelMessagePosted` watches one team channel and emits both root messages
and replies.

## Example

```ts automations/watch-teams-channel.automation.ts theme={null}
import { automation } from "automate.ax"
import {
  onChannelMessagePosted,
  replyToChannelMessage,
} from "automate.ax/teams"

export default automation("Watch Teams help channel", () => {
  const message = onChannelMessagePosted({
    team: "Engineering",
    channel: "Help",
  })
  replyToChannelMessage({
    team: message.teamId,
    channel: message.channelId,
    messageId: message.messageId,
    body: "Your request is in the queue.",
  })
})
```

## Options

| Option    | Type                                                 | Required | Default         | Description                                              |
| --------- | ---------------------------------------------------- | -------- | --------------- | -------------------------------------------------------- |
| `team`    | `string`                                             | Yes      | —               | Exact team display name or ID, trimmed at deployment.    |
| `channel` | `string`                                             | Yes      | —               | Exact channel display name or ID, trimmed at deployment. |
| `account` | `string \| IntegrationAccountReference<"microsoft">` | No       | Project default | Static Microsoft binding.                                |

## Trigger data

Returns `TeamsChatMessage & { teamId: string; channelId: string }`. The message
includes normalized body, ID, sender, timestamps, attachments, mentions,
reactions, importance, optional `replyToId`, and provider metadata. A
`replyToId` distinguishes replies from root posts.

Options are static subscription configuration and cannot use runtime signals.
