getGameHighScores method
Gets data for high score tables.
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
Implementation
Future<List<GameHighScore>> getGameHighScores(
int userId, {
ID? chatId,
int? messageId,
String? inlineMessageId,
}) async {
final params = <String, dynamic>{
'user_id': userId,
'chat_id': ?chatId,
'message_id': ?messageId,
'inline_message_id': ?inlineMessageId,
};
final payload = Payload(params);
final response = await _makeRequest<List<dynamic>>(
APIMethod.getGameHighScores.name,
payload,
);
return response.map((json) => GameHighScore.fromJson(json)).toList();
}