INNER CODE UNIT · Python
get_own_identity
zapek/Xeres · scripts/bot/bot.py:85
def get_own_identity():
r = requests.get(XERES_API_URL + XERES_API_PREFIX + "/identities/1")
if r.status_code != 200:
raise RuntimeError("Couldn't get own identity")
return json.loads(r.text)
def get_own_location():
r = requests.get(XERES_API_URL + XERES_API_PREFIX + "/locations/1")
if r.status_code != 200:
raise RuntimeError("Couldn't get own location")
return json.loads(r.text)
def get_own_rsid():
r = requests.get(XERES_API_URL + XERES_API_PREFIX + "/locations/1/rs-id")
if r.status_code != 200:
raise RuntimeError(f"Couldn't get own RsId: {r.status_code}")