Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
while True:
mahInput = input("\nPlease give me a Minecraft username/UUID: ")
optionInput = input("Please select from list: {}\n> ".format(options))
try:
if optionInput.lower() == "rank":
player = hypixel.Player(mahInput)
playerJSON = player.getJSON()
print("The player is rank: " + player.getRank()['rank'])
print("Were they previously a staff member? {}".format(player.getRank()['wasStaff']))
elif optionInput.lower() == "level":
pass
elif optionInput.lower() == "karma":
player = hypixel.Player(mahInput)
player.getJSON()
karma = player.JSON['player']['karma']
print(karma)
elif optionInput.lower() == "twitter":
player = hypixel.Player(mahInput)
player.getJSON()
try:
social = player.JSON['player']['socialMedia']
print(social['TWITTER'])
except KeyError:
print("This user doesn't have a Twitter account linked.")
except hypixel.PlayerNotFoundException:
print("Cannot find player. :/")