Search messages
search_messagesSearch a Discord channel for recent messages by content and author, scanning history up to a configurable limit and reporting how far it looked.
Instructions
Search recent messages in one channel by content and author. The bot API has no native search, so this scans history newest to oldest up to scan_limit messages and reports exactly how far it looked. Results are case-insensitive substring matches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | Channel name or ID to search in. | |
| guild | No | Guild (server) name or ID. Omit to use the default guild. | |
| query | Yes | Text to look for. | |
| author | No | Only messages whose author name matches this. | |
| limit | No | Max results. Default 10. | |
| scan_limit | No | How many messages to scan before stopping. Default 300. |