Skip to content

feat: Guild Message Search#3160

Draft
NeloBlivion wants to merge 24 commits intoPycord-Development:masterfrom
NeloBlivion:search
Draft

feat: Guild Message Search#3160
NeloBlivion wants to merge 24 commits intoPycord-Development:masterfrom
NeloBlivion:search

Conversation

@NeloBlivion
Copy link
Member

@NeloBlivion NeloBlivion commented Mar 19, 2026

Summary

Implements discord/discord-api-docs#8010
Requires MESSAGE_CONTENT intent and READ_MESSAGE_HISTORY in relevant channels
Pending:

  • Docs
  • Iterator parsing for threads and threadmembers
  • Don't really know how I want to handle has and author_types, spec allows inversion with - so instead of an enum list i went with a True/False class (e.g. SearchHas(embed=True, link=True, image=False))
  • Maybe move param parsing inside the iterator?
  • Possibly change return from List[Message] to a SearchResults object

Information

  • 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, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@pycord-app
Copy link

pycord-app bot commented Mar 19, 2026

Thanks for opening this pull request!
Please make sure you have read the Contributing Guidelines and Code of Conduct.

This pull request can be checked-out with:

git fetch origin pull/3160/head:pr-3160
git checkout pr-3160

This pull request can be installed with:

pip install git+https://github.com/Pycord-Development/pycord@refs/pull/3160/head

@NeloBlivion
Copy link
Member Author

iterator seems to function reliably now

@Paillat-dev
Copy link
Member

For the conditions we could have hijacked python dunders kinda like sqlalchemy but I feel like it would have been a little overkill.



class Parsable:
# idk this kinda sucks lmao
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

sort_by: SearchSortMode | None = None,
sort_order: SearchSortOrder | None = SearchSortOrder.desc,
include_nsfw: bool | None = False,
) -> list[Message]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lie

for invite in data
]

def search(self, **params):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to type this

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants