SHARE
TWEET

beta slots leaderboards

luckytyphlosion Nov 5th, 2015 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top