Remove GameHighScores type · Python-Repository-Hub/pyrogram@a769fdf · GitHub
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

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

pyrogram/client/types/keyboards/game_high_scores.py

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

0 commit comments

Comments
 (0)