Skip to content

feat: guild join requests - #3383

Draft
Soheab wants to merge 14 commits into
masterfrom
feat/guild-join-requests
Draft

feat: guild join requests#3383
Soheab wants to merge 14 commits into
masterfrom
feat/guild-join-requests

Conversation

@Soheab

@Soheab Soheab commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #3340

This PR adds support for getting and taking action on guild join requests/applications.

API Docs: discord/discord-api-docs#8531

This adds:

  • PartialJoinRequest & JoinRequest & FormResponse
  • JoinRequestStatus (Enum)
  • JoinRequestFormFieldType (Enum)
  • JoinRequestAction (Enum)
  • Guild.fetch_join_requests()
  • HTTPClient.get_guild_join_requests() & HTTPClient.action_guild_join_request()
  • JoinRequestIterator
  • on_raw_guild_join_request_delete & RawGuildJoinRequestDeleteEvent
  • on_guild_join_request_create
  • on_guild_join_request_update

Codex was used for the added iterator and documentations.

Needs testing.

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.
  • I have read the Contributing Guidelines.
  • AI Usage has been disclosed.
    • If AI has been used, I understand fully what the code does

@Soheab Soheab added this to the 2.9.0 milestone Sep 5, 2026
@Soheab Soheab self-assigned this Sep 5, 2026
@Soheab
Soheab requested review from a team and Lulalaby September 5, 2026 21:40
@Soheab Soheab added priority: medium Medium Priority feature Implements a feature hold: changelog This pull request is missing a changelog entry labels Sep 5, 2026
@Soheab
Soheab requested a review from DA-344 September 5, 2026 21:40
@Soheab Soheab added hold: testing This pull request requires further testing hold: discussion This pull request needs to be further discussed between maintainers labels Sep 5, 2026
@Soheab
Soheab requested a review from a team as a code owner September 5, 2026 21:40
@Soheab
Soheab requested a review from ToothyDev September 5, 2026 21:40
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Sep 5, 2026
@pycord-app

pycord-app Bot commented Sep 5, 2026

Copy link
Copy Markdown

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/3383/head:pr-3383
git checkout pr-3383

This pull request can be installed with:

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

@Paillat-dev
Paillat-dev self-requested a review September 5, 2026 21:54
@Paillat-dev Paillat-dev modified the milestones: 2.9.0, 2.9.0rc1 Sep 5, 2026
Comment thread discord/types/guild_join_request.py
Comment thread discord/enums.py
Comment thread discord/guild.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/http.py
Comment thread discord/raw_models.py Outdated
Comment thread discord/state.py
data["guild_id"],
)

def parse_guild_join_request_create(self, data: JoinRequestCreatePayload) -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wonder if we still would wanna cache these...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could..

Comment thread discord/guild.py Outdated
Comment thread discord/http.py Outdated
Comment thread discord/types/guild_join_request.py Outdated
Comment thread discord/types/guild_join_request.py Outdated
Comment thread discord/enums.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/guild_join_request.py Outdated
Comment thread discord/types/guild_join_request.py
The ID of the guild the join request belongs to.
guild: :class:`discord.Guild`
The guild the join request belongs to.
application_status: :class:`JoinRequestStatus`

@Soheab Soheab Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
application_status: :class:`JoinRequestStatus`
application_status: :class:`JoinRequestStatus` | :data:`None`

Comment on lines +61 to +62
guild: :class:`discord.Guild`
The guild the join request belongs to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
guild: :class:`discord.Guild`
The guild the join request belongs to.


@property
def guild(self) -> Guild | None:
"""Optional[:class:`discord.Guild`]: The guild the join request belongs to.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
"""Optional[:class:`discord.Guild`]: The guild the join request belongs to.
""":class:`discord.Guild` | :data:`None`: The guild the join request belongs to.

----------
action: :class:`JoinRequestAction`
The action to take on the join request.
rejection_reason: Optional[:class:`str`]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
rejection_reason: Optional[:class:`str`]
rejection_reason: :class:`str` | :data:`None`

@vmphase vmphase left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please use a typechecker before pushing commits.

Comment thread discord/iterators.py
def create_join_request(self, data: JoinRequestPayload) -> JoinRequest:
from .guild_join_request import JoinRequest

return JoinRequest(guild=self.guild, state=self.state, data=data)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

JoinRequest no longer takes a guild kwarg; will cause a TypeError.

Suggested change
return JoinRequest(guild=self.guild, state=self.state, data=data)
return JoinRequest(state=self.state, data=data)

Comment on lines +328 to +336
response: str | int | bool | None = data.get("response")
if (
self.field_type is JoinRequestFormFieldType.MULTIPLE_CHOICE
and isinstance(response, int)
and self.choices is not None
and 0 <= response < len(self.choices)
):
self.choice_index = response
self.response = self.choices[self.choice_index]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

self.response only ever gets set inside the MULTIPLE_CHOICE branch. For TERMS, TEXT_INPUT and PARAGRAPH it stays None forever, even though data.get("response") may contain some value. Not sure it's intended...

"form_responses",
"rejection_reason",
"reviewed_at",
"status",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The attribute is application_status, not status, which is inherited from PartialJoinRequest and doesn't need to be re-slotted here.

Suggested change
"status",

Comment on lines +275 to +276
.. versionadded:: 2.9
If the join request has already been approved or rejected, this will raise :exc:`ValueError`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh?

Suggested change
.. versionadded:: 2.9
If the join request has already been approved or rejected, this will raise :exc:`ValueError`.
.. versionadded:: 2.9

)
from .mixins import Hashable

__all__ = ("FormResponse", "JoinRequest")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
__all__ = ("FormResponse", "JoinRequest")
__all__ = ("FormResponse", "JoinRequest", "PartialJoinRequest")

Comment thread discord/guild.py
Usage ::

async for request in guild.join_requests(limit=250):
print(request.user, request.status)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
print(request.user, request.status)
print(request.user, request.application_status)

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

Labels

feature Implements a feature hold: changelog This pull request is missing a changelog entry hold: discussion This pull request needs to be further discussed between maintainers hold: testing This pull request requires further testing priority: medium Medium Priority

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

Support for Guild Join Requests (aka Server Member Applications)

3 participants