import requests
import json
bot_token = "MTMyNzcxNDM3MTEyMzgxMDMwNA.GwLjEd.quGP0FA5gHRe1xLyuYq-ANuJ5cRuRQ6dhJiojI"
guild_id = "954201387770736751"
discord_id = "189202462442389514"
headers = {'Authorization': f'Bot {bot_token}'}
discord_guild_endpoint = f"https://discord.com/api/v10/guilds/{guild_id}/members/{discord_id}"
response = requests.get(discord_guild_endpoint, headers=headers)
print(response.status_code)


if response.status_code == 200:
    discord_user = response.json()
    with open('test2.json', 'w+') as file:
        file.write(json.dumps(discord_user, indent=5))

    avatar_decor_endpoint = "https://cdn.discordapp.com/" + f"avatar-decoration-presets/{discord_user["user"]["avatar_decoration_data"]["asset"]}.png"
    response = requests.get(avatar_decor_endpoint, headers=headers)
    with open("avatar_decoration.png", "wb") as f:
        f.write(response.content)