1

I am coding a bot for discord using discord.py and I have a command to authenticate Minecraft accounts with the server. I would like to check the accounts with the API to make sure they are valid. right now, I am able to use requests to check if the Java account is valid using this code:

import requests
import discord

username = 'playersusername' #the player username would be replaced with a value coming from the bot, this is just test code
url = f'https://api.mojang.com/users/profiles/minecraft/{username}?'
javacheck = requests.get(url)
status = javacheck.status_code
print(javacheck.status_code)

if status != 204: #makes sure the page exists. when it doesn't the api throws 204
    uuid = javacheck.json()['ID']
    print(uuid)

However, I am unable to find any way to make this work with the Xbox Live API (for my bedrock edition players) can anyone help push me in the right direction?

Dharman
  • 30,962
  • 25
  • 85
  • 135
OhNo2
  • 7
  • 3
  • Perhaps you can add some detail to you answer about what specifically doesn't work with your code at the moment. Do you get any error messages perhaps? – scotty3785 Oct 14 '20 at 09:30

0 Answers0