Skip to content

refactor(invite): improve typing, simplify typeddicts - #3313

Open
vmphase wants to merge 27 commits into
masterfrom
fix/invite-optional-code
Open

refactor(invite): improve typing, simplify typeddicts#3313
vmphase wants to merge 27 commits into
masterfrom
fix/invite-optional-code

Conversation

@vmphase

@vmphase vmphase commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

Invite.__init__ accepts VanityInvite as a type, but VanityInvite.code is optional.
Hence, if code is None, Invite.url interpolates it (str(None) yields None) resulting https://discord.gg/None.

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

@vmphase
vmphase requested review from a team, NeloBlivion and plun1331 July 21, 2026 15:31
@vmphase
vmphase requested a review from a team as a code owner July 21, 2026 15:31
@vmphase
vmphase requested review from Lulalaby and removed request for a team July 21, 2026 15:31
@github-project-automation github-project-automation Bot moved this to Todo in Pycord Jul 21, 2026
@pycord-app

pycord-app Bot commented Jul 21, 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/3313/head:pr-3313
git checkout pr-3313

This pull request can be installed with:

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

@vmphase
vmphase requested a review from a team as a code owner July 21, 2026 15:33
@vmphase
vmphase requested review from a team, EmmmaTech and VincentRPS July 21, 2026 15:33
@vmphase
vmphase requested a review from a team July 21, 2026 15:58

@Paillat-dev Paillat-dev 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.

What are the specific cases where code is missing ?

Comment thread discord/invite.py
@Paillat-dev Paillat-dev added this to the 2.9.0rc1 milestone Jul 26, 2026
@vmphase

vmphase commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

What are the specific cases where code is missing ?

Can't recall for now but it potentially could be, because it returns a partial invite object.

Comment thread CHANGELOG.md Outdated
@vmphase
vmphase force-pushed the fix/invite-optional-code branch from 670b844 to 2d2c542 Compare August 3, 2026 19:03
@vmphase
vmphase requested a review from Paillat-dev August 3, 2026 19:03
ToothyDev
ToothyDev previously approved these changes Aug 7, 2026
Lulalaby
Lulalaby previously approved these changes Aug 7, 2026
NeloBlivion
NeloBlivion previously approved these changes Aug 7, 2026
Paillat-dev
Paillat-dev previously approved these changes Aug 10, 2026

@Paillat-dev Paillat-dev 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.

Very nitpicky comments but lgtm, thanks, and improving typing is always nice.

Comment thread discord/invite.py Outdated
Comment thread discord/invite.py Outdated
@vmphase vmphase changed the title fix(invite): guard against None code refactor(invite): improve typing, simplify typeddicts Aug 10, 2026
Comment thread discord/invite.py Outdated
Comment thread CHANGELOG.md Outdated
vmphase and others added 2 commits August 10, 2026 20:38
Co-authored-by: ToothyDev <55001472+ToothyDev@users.noreply.github.com>
Signed-off-by: Michael <vmphase.dev@gmail.com>
Co-authored-by: ToothyDev <55001472+ToothyDev@users.noreply.github.com>
Signed-off-by: Michael <vmphase.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants