-
Notifications
You must be signed in to change notification settings - Fork 5.7k
API 9.1 General #4851
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
API 9.1 General #4851
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e7e544e
Add get_my_star_balance
harshil21 c4457ea
DirectMessagePriceChanged + filters
harshil21 12d5aea
Add chango fragment for PR #4851
harshil21 d8a8c4d
Copilot Review: change import, eq check
harshil21 47c38a7
Fix test:
harshil21 468aed6
Review: Add another eq test case
harshil21 dc4b71f
Review: update constant and fixture
harshil21 81b047c
Add versionchanged to the constant
harshil21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
other = "API 9.1 General" | ||
[[pull_requests]] | ||
uid = "4851" | ||
author_uid = "harshil21" | ||
closes_threads = [] |
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,6 @@ | ||
DirectMessagePriceChanged | ||
========================= | ||
|
||
.. autoclass:: telegram.DirectMessagePriceChanged | ||
: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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/usr/bin/env python | ||
# | ||
# A library that provides a Python interface to the Telegram Bot API | ||
# Copyright (C) 2015-2025 | ||
# 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 Direct Message Price.""" | ||
|
||
|
||
from typing import Optional | ||
|
||
from telegram._telegramobject import TelegramObject | ||
from telegram._utils.types import JSONDict | ||
|
||
|
||
class DirectMessagePriceChanged(TelegramObject): | ||
""" | ||
Describes a service message about a change in the price of direct messages sent to a channel | ||
chat. | ||
|
||
.. versionadded:: NEXT.VERSION | ||
|
||
Objects of this class are comparable in terms of equality. Two objects of this class are | ||
considered equal, if their :attr:`are_direct_messages_enabled`, and | ||
:attr:`direct_message_star_count` are equal. | ||
|
||
Args: | ||
are_direct_messages_enabled (:obj:`bool`): | ||
:obj:`True`, if direct messages are enabled for the channel chat; :obj:`False` | ||
otherwise. | ||
direct_message_star_count (:obj:`int`, optional): | ||
The new number of Telegram Stars that must be paid by users for each direct message | ||
sent to the channel. Does not apply to users who have been exempted by administrators. | ||
Defaults to ``0``. | ||
|
||
Attributes: | ||
are_direct_messages_enabled (:obj:`bool`): | ||
:obj:`True`, if direct messages are enabled for the channel chat; :obj:`False` | ||
otherwise. | ||
direct_message_star_count (:obj:`int`): | ||
Optional. The new number of Telegram Stars that must be paid by users for each direct | ||
message sent to the channel. Does not apply to users who have been exempted by | ||
administrators. Defaults to ``0``. | ||
""" | ||
|
||
__slots__ = ("are_direct_messages_enabled", "direct_message_star_count") | ||
|
||
def __init__( | ||
self, | ||
are_direct_messages_enabled: bool, | ||
direct_message_star_count: Optional[int] = None, | ||
*, | ||
api_kwargs: Optional[JSONDict] = None, | ||
): | ||
super().__init__(api_kwargs=api_kwargs) | ||
self.are_direct_messages_enabled: bool = are_direct_messages_enabled | ||
self.direct_message_star_count: Optional[int] = direct_message_star_count | ||
|
||
self._id_attrs = (self.are_direct_messages_enabled, self.direct_message_star_count) | ||
|
||
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
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
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.