示例#1
0
 def test_get_profile(self):
     profile = MojangAPI.get_profile(self.NOTCH_UUID)
     self.assertEqual(profile.id, self.NOTCH_UUID)
     self.assertEqual(profile.name, self.NOTCH_USERNAME)
     self.assertIsInstance(profile.timestamp, int)
     profile = MojangAPI.get_profile(self.INVALID_UUID)
     self.assertEqual(profile, None)
示例#2
0
async def mclookup(ctx, *, message: str = None):
    uuid = MojangAPI.get_uuid(f"{message}")

    if not uuid:
        embed = discord.Embed(title="This player doesn't exist!",
                              color=discord.Color.red())
        embed.set_author(name=f'Error!', )
        embed.set_footer(
            text=
            f"MC Lookup | Requested by {ctx.author} | BOT By Junai#0001 🔧")
        print(
            f"MC Lookup | Requested by {ctx.author} | BOT By Junai#0001 🔧")
        await ctx.send(embed=embed)
    else:
        profile = MojangAPI.get_profile(uuid)
        embed = discord.Embed(title=f"Profile Details",
                              color=discord.Color.green())
        embed.add_field(name="UUID", value=uuid)
        embed.add_field(name="Skin URL", value=profile.skin_url)
        embed.add_field(name="NameMC Link",
                        value="https://namemc.com/profile/" + uuid)
        embed.set_footer(
            text=
            f"MC Lookup | Requested by {ctx.author} | BOT By Junai#0001 🔧")
        print(
            f"MC Lookup | Requested by {ctx.author} | BOT By Junai#0001 🔧")
        await ctx.send(embed=embed)
示例#3
0
from mojang import MojangAPI
print(
    'ys////////////////////////////////////sy\nyo                                    oy\nyo                                    oy\nyo             oooooooooo             oy\nyo             yyyyyyyyyy             oy\nyo             yyyyyyyyyy             oy\nyo             yyyyyyyyyy             oy\nyo   ``````````yyyyyyyyyy``````````   oy\nyo   ssssssssssyyyyyyyyyyssssssssss   oy\nyo   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   oy\nyo   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   oy\nyo   yyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   oy\nyo   ``````````yyyyyyyyyy``````````   oy\nyo             yyyyyyyyyy             oy\nyo             yyyyyyyyyy             oy\nyo             yyyyyyyyyy             oy\nyo             oooooooooo             oy\nyo                                    oy\nyo                                    oy\nys////////////////////////////////////sy\n\n\n'
)
print(
    '1) Username to uuid.\n2) Uuid to username.\n3)Username/Uuid to skin url.\n4) Username/uuid to cape.'
)
selection = input()
if selection == '3':
    username_or_uuid = input(
        "Type 'user' to use username to find skin, or type uuid to find skin with your uuid"
    )
    if username_or_uuid == 'user':
        username_or_uuid_username = input("Enter your username")
        uuid_get = MojangAPI.get_uuid(username_or_uuid_username)
        profile_skin = MojangAPI.get_profile(uuid_get)
        print('The skin url is: ', profile_skin.skin_url)
    elif username_or_uuid == 'uuid':
        uuid_input = input('Enter uuid: ')
        profile_skin_uuid = MojangAPI.get_profile(uuid_input)
        print('The skin url is: ', profile_skin_uuid.skin_url)

if selection == '1':
    username_input = input('Enter your current minecraft username: '******'There uuid is: ' + uuid)

if selection == '2':