tg_wait
Wait for a matching Telegram message in a chat and return it. Use to pause until a reply arrives, without polling; returns false on timeout.
Instructions
Block until a matching message arrives, then return it.
This is the right way to "wait for their reply" — the daemon is already listening to Telegram, so waiting costs nothing and misses nothing. Do not poll tg_events in a loop instead.
Returns got=false on timeout; that means nothing arrived, not that something failed.
Args: chat: only messages in this chat (id, @username or exact title). from_user: only messages from this person (id, @username or name). keyword: only messages whose text contains this. timeout: seconds to wait, 5 to 600. private_only: ignore groups and channels.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat | No | ||
| keyword | No | ||
| timeout | No | ||
| from_user | No | ||
| private_only | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |