Skip to content

Commit a769fdf

Browse files
committed
Remove GameHighScores type
1 parent cfbc529 commit a769fdf

4 files changed

Lines changed: 12 additions & 76 deletions

File tree

docs/source/api/types.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ Keyboards
7171
- :class:`ForceReply`
7272
- :class:`CallbackQuery`
7373
- :class:`GameHighScore`
74-
- :class:`GameHighScores`
7574
- :class:`CallbackGame`
7675

7776
Input Media
@@ -150,7 +149,6 @@ Details
150149
.. autoclass:: ForceReply()
151150
.. autoclass:: CallbackQuery()
152151
.. autoclass:: GameHighScore()
153-
.. autoclass:: GameHighScores()
154152
.. autoclass:: CallbackGame()
155153

156154
.. Input Media

pyrogram/client/methods/bots/get_game_high_scores.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
from typing import Union
19+
from typing import Union, List
2020

2121
import pyrogram
2222
from pyrogram.api import functions
@@ -29,7 +29,7 @@ def get_game_high_scores(
2929
user_id: Union[int, str],
3030
chat_id: Union[int, str],
3131
message_id: int = None
32-
) -> "pyrogram.GameHighScores":
32+
) -> List["pyrogram.GameHighScore"]:
3333
"""Get data for high score tables.
3434
3535
Parameters:
@@ -49,20 +49,19 @@ def get_game_high_scores(
4949
Required if inline_message_id is not specified.
5050
5151
Returns:
52-
:obj:`GameHighScores`: On success.
52+
List of :obj:`GameHighScore`: On success.
5353
5454
Raises:
5555
RPCError: In case of a Telegram RPC error.
5656
"""
5757
# TODO: inline_message_id
5858

59-
return pyrogram.GameHighScores._parse(
60-
self,
61-
self.send(
62-
functions.messages.GetGameHighScores(
63-
peer=self.resolve_peer(chat_id),
64-
id=message_id,
65-
user_id=self.resolve_peer(user_id)
66-
)
59+
r = self.send(
60+
functions.messages.GetGameHighScores(
61+
peer=self.resolve_peer(chat_id),
62+
id=message_id,
63+
user_id=self.resolve_peer(user_id)
6764
)
6865
)
66+
67+
return pyrogram.List(pyrogram.GameHighScore._parse(self, score, r.users) for score in r.scores)

pyrogram/client/types/keyboards/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
from .callback_query import CallbackQuery
2121
from .force_reply import ForceReply
2222
from .game_high_score import GameHighScore
23-
from .game_high_scores import GameHighScores
2423
from .inline_keyboard_button import InlineKeyboardButton
2524
from .inline_keyboard_markup import InlineKeyboardMarkup
2625
from .keyboard_button import KeyboardButton
2726
from .reply_keyboard_markup import ReplyKeyboardMarkup
2827
from .reply_keyboard_remove import ReplyKeyboardRemove
2928

3029
__all__ = [
31-
"CallbackGame", "CallbackQuery", "ForceReply", "GameHighScore", "GameHighScores", "InlineKeyboardButton",
32-
"InlineKeyboardMarkup", "KeyboardButton", "ReplyKeyboardMarkup", "ReplyKeyboardRemove"
30+
"CallbackGame", "CallbackQuery", "ForceReply", "GameHighScore", "InlineKeyboardButton", "InlineKeyboardMarkup",
31+
"KeyboardButton", "ReplyKeyboardMarkup", "ReplyKeyboardRemove"
3332
]

pyrogram/client/types/keyboards/game_high_scores.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)