tg_wait
Wait for a matching Telegram message in a chat, from a user, or containing a keyword. Blocks until it arrives or times out, returning got=false when nothing arrives—so no polling loop needed.
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 |