mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
SteamIDs!
This commit is contained in:
parent
f39b077844
commit
9380226408
1 changed files with 16 additions and 0 deletions
16
db.py
16
db.py
|
@ -72,6 +72,22 @@ class Steam(Base):
|
||||||
else:
|
else:
|
||||||
return self.steam_id
|
return self.steam_id
|
||||||
|
|
||||||
|
def steam_id_1(self):
|
||||||
|
return self.steam_id
|
||||||
|
|
||||||
|
def steam_id_2(self):
|
||||||
|
# Got this code from a random github gist. It could be completely wrong.
|
||||||
|
z = (int(self.steam_id) - 76561197960265728) // 2
|
||||||
|
y = int(self.steam_id) % 2
|
||||||
|
return f"STEAM_0:{y}:{z}"
|
||||||
|
|
||||||
|
def steam_id_3(self, full=False):
|
||||||
|
# Got this code from a random github gist. It could be completely wrong.
|
||||||
|
if full:
|
||||||
|
return f"[U:1:{int(self.steam_id) - 76561197960265728}]"
|
||||||
|
else:
|
||||||
|
return f"{int(self.steam_id) - 76561197960265728}"
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
r = requests.get(f"https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key={config['Steam']['api_key']}&steamids={self.steam_id}")
|
r = requests.get(f"https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key={config['Steam']['api_key']}&steamids={self.steam_id}")
|
||||||
if r.status_code != 200:
|
if r.status_code != 200:
|
||||||
|
|
Loading…
Reference in a new issue