1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-30 15:04:18 +00:00
royalnet/newuser.py

47 lines
1.1 KiB
Python
Raw Normal View History

2017-10-17 18:49:28 +00:00
import db
2017-10-30 09:46:37 +00:00
session = db.Session()
2018-03-21 20:17:34 +00:00
username = input("Nome account: ")
user = session.query(db.Royal).filter_by(username=username).one_or_none()
if user is None:
user = db.Royal.create(session, username)
2017-10-30 09:46:37 +00:00
session.add(user)
session.commit()
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
steam = db.Steam.create(session, user.id, input("Steam ID 1: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(steam)
2018-06-05 10:33:26 +00:00
try:
dota = db.Dota.create(session, steam.steam_id)
except Exception as e:
print(e)
else:
session.add(dota)
try:
rl = db.RocketLeague.create(session, steam.steam_id)
except Exception as e:
print(e)
else:
session.add(rl)
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
osu = db.Osu.create(session, user.id, input("Osu! username: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(osu)
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
overwatch = db.Overwatch.create(session, user.id, input("Battle.net battletag: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(overwatch)
2017-10-25 09:09:06 +00:00
try:
2017-10-30 09:46:37 +00:00
lol = db.LeagueOfLegends.create(session, user.id, input("League summoner name: "))
2017-10-27 09:53:05 +00:00
except Exception as e:
print(e)
2017-10-25 09:09:06 +00:00
else:
2017-10-30 09:46:37 +00:00
session.add(lol)
session.commit()
session.close()