add support for uuids in /stealskin
@@ -247,8 +247,7 @@ class Minecraft(commands.Cog):
@commands.command(name='stealskin', aliases=['getskin', 'skin', 'mcskin'])
@commands.cooldown(1, 2.5, commands.BucketType.user)
async def steal_skin(self, ctx, player):
- """"steals" the skin of a Minecraft player"""
-
+ if 17 > len(player) > 1 and player.lower().strip('abcdefghijklmnopqrstuvwxyz1234567890_') == '':
with ctx.typing():
res = await self.ses.get(f'https://api.mojang.com/users/profiles/minecraft/{player}')
@@ -259,7 +258,13 @@ class Minecraft(commands.Cog):
await self.bot.send(ctx, ctx.l.minecraft.stealskin.error)
return
- uuid = (await res.json())['id']
+ jj = await res.json()
+ uuid = jj['id']
+ elif len(player) in (32, 36,) and player.lower().strip('abcdefghijklmnopqrstuvwxyz1234567890-') == '': # player is a uuid
+ uuid = player.replace('-', '')
+ else:
+ await self.bot.send(ctx, ctx.l.minecraft.invalid_player)
+ return
with ctx.typing():
res = await self.ses.get(f'https://sessionserver.mojang.com/session/minecraft/profile/{uuid}')
