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
2121import pyrogram
2222from 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 )
0 commit comments