-
Notifications
You must be signed in to change notification settings - Fork 6k
Api 9.3: Add UniqueGiftColors & ChatFullInfo Updates
#5084
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e78f8c2
add UserRating class
Bibo-Joshi d91eee5
add UniqueGiftColors class
Bibo-Joshi 81fdec5
update ChatFullInfo
Bibo-Joshi d8dc2d4
update chango fragment
Bibo-Joshi af6ce14
chango typo
Bibo-Joshi e4e11f3
review
Bibo-Joshi f348897
Merge branch 'api-9.3-central' into api-9.3-chat-full-info
Bibo-Joshi 5b483aa
Merge branch 'api-9.3-central' into api-9.3-chat-full-info
Bibo-Joshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| UniqueGiftColors | ||
| ================ | ||
|
|
||
| .. autoclass:: telegram.UniqueGiftColors | ||
| :members: | ||
| :show-inheritance: | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| UserRating | ||
| ========== | ||
|
|
||
| .. autoclass:: telegram.UserRating | ||
| :members: | ||
| :show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #!/usr/bin/env python | ||
| # | ||
| # A library that provides a Python interface to the Telegram Bot API | ||
| # Copyright (C) 2015-2026 | ||
| # Leandro Toledo de Souza <devs@python-telegram-bot.org> | ||
| # | ||
| # This program is free software: you can redistribute it and/or modify | ||
| # it under the terms of the GNU Lesser Public License as published by | ||
| # the Free Software Foundation, either version 3 of the License, or | ||
| # (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU Lesser Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU Lesser Public License | ||
| # along with this program. If not, see [http://www.gnu.org/licenses/]. | ||
| """This module contains an object that represents a Telegram user rating.""" | ||
|
|
||
| from telegram._telegramobject import TelegramObject | ||
| from telegram._utils.types import JSONDict | ||
|
|
||
|
|
||
| class UserRating(TelegramObject): | ||
| """ | ||
| This object describes the rating of a user based on their Telegram Star spendings. | ||
|
|
||
| Objects of this class are comparable in terms of equality. Two objects of this class are | ||
| considered equal, if their :attr:`level` and :attr:`rating` are equal. | ||
|
|
||
| .. versionadded:: NEXT.VERSION | ||
|
|
||
| Args: | ||
| level (:obj:`int`): Current level of the user, indicating their reliability when purchasing | ||
| digital goods and services. A higher level suggests a more trustworthy customer; a | ||
| negative level is likely reason for concern. | ||
| rating (:obj:`int`): Numerical value of the user's rating; the higher the rating, the | ||
| better | ||
| current_level_rating (:obj:`int`): The rating value required to get the current level | ||
| next_level_rating (:obj:`int`, optional): The rating value required to get to the next | ||
| level; omitted if the maximum level was reached | ||
|
|
||
| Attributes: | ||
| level (:obj:`int`): Current level of the user, indicating their reliability when purchasing | ||
| digital goods and services. A higher level suggests a more trustworthy customer; a | ||
| negative level is likely reason for concern. | ||
| rating (:obj:`int`): Numerical value of the user's rating; the higher the rating, the | ||
| better | ||
| current_level_rating (:obj:`int`): The rating value required to get the current level | ||
| next_level_rating (:obj:`int`): Optional. The rating value required to get to the next | ||
| level; omitted if the maximum level was reached | ||
|
|
||
| """ | ||
|
|
||
| __slots__ = ("current_level_rating", "level", "next_level_rating", "rating") | ||
|
|
||
| def __init__( | ||
| self, | ||
| level: int, | ||
| rating: int, | ||
| current_level_rating: int, | ||
| next_level_rating: int | None = None, | ||
| *, | ||
| api_kwargs: JSONDict | None = None, | ||
| ) -> None: | ||
| super().__init__(api_kwargs=api_kwargs) | ||
| self.level: int = level | ||
| self.rating: int = rating | ||
| self.current_level_rating: int = current_level_rating | ||
| self.next_level_rating: int | None = next_level_rating | ||
|
|
||
| self._id_attrs = (self.level, self.rating) | ||
|
|
||
| self._freeze() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.