Skip to content

feat(guild): support message search endpoint - #1522

Open
shiftinv wants to merge 30 commits into
masterfrom
feat/message-search
Open

feat(guild): support message search endpoint#1522
shiftinv wants to merge 30 commits into
masterfrom
feat/message-search

Conversation

@shiftinv

Copy link
Copy Markdown
Member

Summary

discord/discord-api-docs@62a0276

This implements /guilds/{}/messages/search, which allows searching for messages in a guild or specific channels with 24(!) different query parameters. Makes this PR look quite a bit more complex than it really is c:

One thing of note is the non-standard pagination with a separate offset instead of the usual before/after, as well as some special casing that's unfortunately required since the search indexer works in mysterious ways and can sometimes just return empty result pages (due to deleted messages/channels? would be my guess. anyway.).
Additionally, there are situations where we receive a 202 Accepted while the guild is still being indexed, in which case the code automatically retries a configurable number of times after the given delay. So far I've only really seen this in guilds where search had never been used before.

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running uv run nox -s lint
    • I have type-checked the code by running uv run nox -s pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

shiftinv added 24 commits May 18, 2026 18:56
…max offset

Some result pages can have fewer (or even zero) results, so just continue paginating
until we either hit the max offset of 9975, or the total number of available results
@shiftinv shiftinv added this to the disnake v2.13 milestone May 20, 2026
@shiftinv shiftinv added t: enhancement New feature t: api support Support of Discord API features s: needs review Issue/PR is awaiting reviews labels May 20, 2026
@shiftinv shiftinv added this to disnake May 20, 2026
@github-project-automation github-project-automation Bot moved this to Todo in disnake May 20, 2026
@read-the-docs-community

read-the-docs-community Bot commented May 20, 2026

Copy link
Copy Markdown

Documentation build overview

📚 disnake | 🛠️ Build #33380333 | 📁 Comparing 4721a71 against latest (263dd7f)

  🔍 Preview build  

72 files changed · ± 72 modified

± Modified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s: needs review Issue/PR is awaiting reviews t: api support Support of Discord API features t: enhancement New feature

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant