Advertisement
luckytyphlosion

beta slots leaderboards

Nov 5th, 2015
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. add_lb_entry = lambda: temp_boards.append([username,userpoints])
  2.        
  3.         temp_boards = []
  4.         for username in slots_data:
  5.             userpoints = slots_data[username]["slots_points"]
  6.             if len(temp_boards) < 5:
  7.                 add_lb_entry()
  8.             else:
  9.                 temp_boards.sort(key=lambda points: points[1], reverse = True)
  10.                 if temp_boards[4][1] < userpoints:
  11.                     temp_boards.pop()
  12.                     add_lb_entry()
  13.        
  14.         boards_message = "<@%s> -> %s" % (saved_message.author.id,temp_boards)
  15.         #for username in temp_boards:
  16.         #   boards_message =
  17.         client.send_message(saved_message.channel, boards_message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement