@client.command(aliases=["card", "usercard", "user_card"])
async def card_user(ctx):
await ctx.channel.purge(limit=1)
img = Image.new('RGBA', (400, 200), '#232529')
url = str(ctx.author.avatar_url)[:-10]
response = requests.get(url, stream=True)
response = Image.open(io.BytesIO(response.content))
response = response.convert('RGBA')
response = response.resize((100, 100), Image.ANTIALIAS)
img.paste(response, (15, 15, 115, 115))
idraw = ImageDraw.Draw(img)
name = ctx.author.name
tag = ctx.author.discriminator
# user = [r.name for r in guild.roles]
# highest = discord.utils.find(lambda role: role in my_roles, reversed(ctx.author.roles))
headline = ImageFont.truetype('fonts/arial.ttf', size=20)
undertext = ImageFont.truetype('fonts/arial.ttf', size=12)
idraw.text((145, 15), f'{name}#{tag}', font=headline)
idraw.text((145, 50), f'ID: {ctx.author.id}', font=undertext)
path = os.getcwd()
img.save(f'{path}/user_card.png')
await ctx.send(file=discord.File(fp=f'{path}/user_card.png'))
os.remove(f'{path}/user_card.png')