Search messages
search_messagesSearch Discord server history across all channels or a named channel, including embeds and polls. Filter by author, content type, pinned state, and sort by newest or relevance.
Instructions
Search the server's message history through Discord's native search index. Covers every channel the bot can read, or one channel if you name it, and looks inside embeds and polls, not just plain text. Matching is whole-word full text, not substring, so search for words rather than fragments. Filter by author, by what a message carries (image, link, file, and so on), or by pinned state, and order by newest first or by relevance.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| has | No | Only messages that carry this kind of content. | |
| sort | No | Order by newest first (recent, the default) or best match (relevant). | |
| guild | No | Guild (server) name or ID. Omit to use the default guild. | |
| limit | No | Max results to return, 1 to 25. Default 10. | |
| query | No | Words to look for. Whole-word full text match, not substring. Optional if you filter by author, has, or pinned instead. | |
| author | No | Only messages from this member (name or ID). | |
| offset | No | Skip this many results, for paging. Default 0. | |
| pinned | No | Only pinned (true) or only unpinned (false) messages. | |
| channel | No | Limit to one channel by name or ID. Default: the whole server. |