-
Notifications
You must be signed in to change notification settings - Fork 0
/
bedwarsshop.py
41 lines (33 loc) · 1.11 KB
/
bedwarsshop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from helpers import load_constants, get_player_data, parse_player_data
from helpers import create_image
import logging
import click
from dotenv import load_dotenv
load_dotenv()
logging.basicConfig(level=logging.INFO,
format="%(asctime)s - %(levelname)s - %(message)s")
@click.command()
@click.argument("player_name", type=str)
def main(player_name):
"""
generates a bedwars shop favorites image for a player.
To use this script, you need to have a Hypixel API key.
Usage: "python run.py <player_name>"
Args:
player_name (str): Username of the player.
"""
if not load_constants():
logging.error("Failed to load constants, exiting...")
return
player_data = get_player_data(player_name)
if not player_data:
logging.error("Failed to retrieve player data, exiting...")
return
player_data = parse_player_data(player_data)
if not player_data:
logging.error("Failed to parse player data, exiting...")
return
print(player_data)
create_image(player_data, player_name)
if __name__ == "__main__":
main()