Skip to content

Conversation

Lumabots
Copy link
Contributor

@Lumabots Lumabots commented May 3, 2025

Summary

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters). Implement better get_or_fetch #1856
  • 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.

Lumabots added 5 commits May 3, 2025 00:37
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Lumabots
Copy link
Contributor Author

Lumabots commented May 3, 2025

feat from #1856

Lumabots and others added 5 commits May 4, 2025 01:30
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Lumabots
Copy link
Contributor Author

Lumabots commented May 3, 2025

still not ready have some bug like : NameError: name 'VoiceChannel' is not defined
ig because of the type checking, i'll have to find a way to import it without circular import

@Paillat-dev
Copy link
Member

@Lumabots You can import it inside of the function where you use it directly instead of importing it at the top

@Lumabots
Copy link
Contributor Author

Lumabots commented May 3, 2025

@Lumabots You can import it inside of the function where you use it directly instead of importing it at the top

Well ig the issue come from the definition for the typevar, so will that resolve it ?

Lumabots and others added 8 commits May 4, 2025 18:22
… get_or_fetch shortcut

Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Lumabots
Copy link
Contributor Author

Lumabots commented May 4, 2025

should be ready for review

@Lumabots
Copy link
Contributor Author

Lumabots commented May 4, 2025

just need to specify that this is breaking inside the changelog cos of modification of get_or_fetch and removal of get_or_fetch_user

Soheab
Soheab previously approved these changes Sep 10, 2025
Copy link
Contributor

@Soheab Soheab left a comment

Choose a reason for hiding this comment

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

Little nitpicks and consistency issues with the docs. LGTM code-wise.

Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Lumabots and others added 3 commits September 10, 2025 12:00
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
Co-authored-by: Soheab <33902984+Soheab@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Lumabots Lumabots requested a review from Soheab September 11, 2025 13:22
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Paillat-dev Paillat-dev requested a review from Copilot September 17, 2025 13:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a better version of the get_or_fetch utility function with improved type safety and error handling. The update introduces new convenience methods on Guild and Client classes while maintaining backward compatibility through deprecation warnings.

  • Replaces string-based object type specification with type class parameters for better type safety
  • Adds new get_or_fetch methods to Guild and Client classes for easier access
  • Maintains backward compatibility by deprecating the old string-based approach

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
discord/utils.py Rewrites the get_or_fetch function with type-safe overloads and helper functions
discord/guild.py Adds get_or_fetch method and get_emoji helper method to Guild class
discord/client.py Adds get_or_fetch method and deprecates get_or_fetch_user
CHANGELOG.md Documents the new features and deprecations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@Paillat-dev Paillat-dev left a comment

Choose a reason for hiding this comment

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

See copilot comment, wtf

Lumabots and others added 5 commits September 18, 2025 22:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com>
@Soheab Soheab requested review from a team and removed request for Lulalaby October 3, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants