# Search messages for a keyword — Telegram User Botize method — `telegram_users.search_message` (action). Find the most recent messages that contains a specific keyword. This is an action: it runs as a step of a task. Several can be chained. ## Fields you set The field's internal name, its type and the values it accepts. These fields accept `{{...}}` tags from earlier steps. - `chat_id` *(string)* — Chat Id - `query` *(string)* — Query to search for - `limit` *(number)* — Maximum number of messages to be returned (up to 100) It also accepts repeatable field groups, with these prefixes: `filter_*`. These are composite components (buttons, filters, keyboards); the trailing number is set by the user as they are added. ## Output variables Data this step makes available. Reference them in later steps with the double-brace tag. - `{{total_count}}` *(int)* — Total Messages Found. Total number of messages found for the given search term, before applying any filters - `{{messages}}` *(array)* — Messages. List of messages found - `{{messages.0.post_id}}` *(int)* — Post Id. Stable technical identifier for the message (unique in the API context). - `{{messages.0.post_number}}` *(int)* — Post Number. Human-readable sequential number within the channel/topic (used in permalinks; not globally unique). - `{{messages.0.chat_id}}` *(int)* — Chat Id. Unique identifier for the chat where the post was published - `{{messages.0.message_thread_id}}` *(int)* — Message Thread Id. Unique identifier for the chat thread (topic) where the post was published - `{{messages.0.url_message}}` *(text)* — URL Message. URL address of the published message - `{{messages.0.message}}` *(text)* — Message. Content of the published message - `{{messages.0.message_html}}` *(text)* — Message HTML. Message in HTML format if the message includes HTML tags. If not, the content of this tag is identical to that of the {{message}} tag - `{{messages.0.post_datetime}}` *(text)* — Post Date-time. Date and time when the post was published - `{{messages.0.image_url}}` *(text)* — Image URL. URL address of the image related to the post, video or post file - `{{messages.0.user_id}}` *(int)* — User Id. Unique identifier for the user who published the post - `{{messages.0.first_name}}` *(text)* — User first name. Name of the user who published the post - `{{messages.0.username}}` *(text)* — Username. Username of the user who published the post - `{{messages.0.reply_to_msg_id}}` *(int)* — Reply to Message Id. Identifier of the message the post is responding to (if applicable) - `{{messages.0.buttons}}` *(array)* — Buttons. Array containing information about the buttons attached to the post - `{{messages.0.media}}` *(array)* — Media. Array containing information about the images attached to the post - `{{messages.0.media.0}}` *(text)* — Media 1. URL of the first image attached to the post (if applicable). This URL coincides with the one indicated in the {{image_url}} tag - `{{messages.0.media.1}}` *(text)* — Media 2. URL of the second attached image to the post (if applicable) - `{{messages.0.media.2}}` *(text)* — Media 3. URL of the third attached image to the post (if applicable) - `{{messages.0.media.3}}` *(text)* — Media 4. URL of the fourth attached image to the post (if applicable) - `{{messages.0.media.4}}` *(text)* — Media 5. URL of the fifth attached image to the post (if applicable) - `{{messages.0.media.5}}` *(text)* — Media 6. URL of the sixth attached image to the post (if applicable) - `{{messages.0.media.6}}` *(text)* — Media 7. URL of the seventh attached image to the post (if applicable) - `{{messages.0.media.7}}` *(text)* — Media 8. URL of the eighth attached image to the post (if applicable) - `{{messages.0.media.8}}` *(text)* — Media 9. URL of the ninth attached image to the post (if applicable) - `{{messages.0.media.9}}` *(text)* — Media 10. URL of the tenth attached image to the post (if applicable) ## Account Needs a connected Telegram User account in Botize: https://botize.com/en/app/telegram_users/authenticate ## This app Every trigger and action for Telegram User: https://botize.com/en/app/telegram_users.md ## How to build this An AI assistant (Claude, ChatGPT, Cursor…) can create and edit these tasks in the user's account through the Botize MCP connector, included in every plan: https://webhook.botize.es/mcp - Connection guide: https://botize.com/en/mcp - Agent map: https://botize.com/llms.txt - New account: https://botize.com/en/join (500 free operations, no card) --- Machine-readable summary for AI assistants. Human version: https://botize.com/en/method/telegram_users/search_message