Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Addname andfull_name properties to theSharedUser class#4708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

david-shiko
Copy link
Contributor

P.S. I failed to update the documentation. Sphinx requires Python 3.12, but I intentionally use Python 3.10. The documentation states that Python 3.9+ is supported, as mentioned in the introduction section:python-telegram-bot Introduction.

Please review the PR, and if everything is okay, I will try to write the documentation.

@Bibo-Joshi
Copy link
Member

Hi. Thanks for the PR, nice idea 👍
Looking at the code base, I see that we already have the properties

  • User.name
  • User.full_name
  • Chat.full_name

and your PR basically copiesUser.name andChat.full_name toSharedUser.
To avoid too much duplication, I would like you instead introduce a new moduletelegram._utils.usernames whith two functionget_name andget_full_name. They would both accept a object of type

classUserLike(typing.Protocol):first_name:typing.Optional[str]last_name:typing.Optional[str]username:typing.Optional[str]

Would that be doable for you?

Note that you can copy the tests fromtest_chat/test_user. I'd like to avoid introducingunittest into our test suite b/c we use nowhere else.

david-shiko and ChiranjibKoch reacted with thumbs up emoji

@Bibo-JoshiBibo-Joshi added the 🔌 enhancementpr description: enhancement labelMar 8, 2025
@david-shikodavid-shiko mentioned this pull requestMar 10, 2025
@Bibo-Joshi
Copy link
Member

Closing in favor of#4713

@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 18, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
Assignees
No one assigned
Labels
🔌 enhancementpr description: enhancement
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@david-shiko@Bibo-Joshi

[8]ページ先頭

©2009-2025 Movatter.jp