Skip to content

Commit

Permalink
Added missing import datetime in mojang.account.base
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucino772 committed Nov 18, 2021
1 parent 1ea73f6 commit 6127716
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
1 change: 1 addition & 0 deletions mojang/account/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import base64
import json
import datetime as dt
from typing import List

import requests
Expand Down
28 changes: 16 additions & 12 deletions mojang/account/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def change_user_skin(access_token: str, path: str, variant="classic"):
skin = Skin(source=path, variant=variant)
files = [
("variant", skin.variant),
("file", ("image.png", skin.data, f"image/png")),
("file", ("image.png", skin.data, "image/png")),
]
response = requests.post(
URLs.change_skin(),
Expand Down Expand Up @@ -174,20 +174,24 @@ def get_profile(access_token: str):

skins = []
for item in data["skins"]:
skins.append(Skin(
item["url"],
item["variant"],
id=item["id"],
state=item["state"],
))
skins.append(
Skin(
item["url"],
item["variant"],
id=item["id"],
state=item["state"],
)
)

capes = []
for item in data["capes"]:
capes.append(Cape(
item["url"],
id=item["id"],
state=item["state"],
))
capes.append(
Cape(
item["url"],
id=item["id"],
state=item["state"],
)
)

return AuthenticatedUserProfile(
name=data["name"],
Expand Down
3 changes: 0 additions & 3 deletions mojang/account/structures/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import datetime as dt
from typing import NamedTuple, Tuple, Union

from .session import Cape, Skin


# Status check
class ServiceStatus(NamedTuple):
"""
Expand Down

0 comments on commit 6127716

Please sign in to comment.