e92d66bd by Barry

Added a count to how many are shown from gamesplayed so you can see the whole list.

1 parent d0be16f0
......@@ -236,7 +236,7 @@ Messages:
!msg <username> on 12/22/2015 Happy Birthday!
Games:
!games <username> - Returns a list of games played for a username.
!gameslist - Returns a list of the top 20 games and the number of people who have played that game.
!gameslist <count> - Returns a list of the top 20 games and the number of people who have played that game. if you pass a limit it will show that many games instead.
!whoplayed <gamename> - Returns a list of players who have played the game.
Spam:
!youtube <search term> - Returns the first video from the search results for the search term.
......@@ -340,6 +340,11 @@ Stuff:
if not data:
client.send_message(message.channel, 'I am a bit confused right now.. maybe I need more data. {}!'.format(message.author.mention()))
else:
parts = message.content.split(' ')
limit = 20
if parts[1].isdigit():
limit = int(parts[1])
game_list = []
for user in data:
if 'games_played' in data[user]:
......@@ -347,7 +352,7 @@ Stuff:
game_list += data[user]['games_played']
print('%s' % game_list)
games_sorted = leaders(get_game_names(game_list))
games_sorted = leaders(get_game_names(game_list), top=limit)
print('%s' % games_sorted)
out_string = ''
for game in games_sorted:
......