Answer the question
In order to leave comments, you need to log in
Module 'io' has no attribute 'BytesID' how to fix?
Hello, I wanted to create a new command for the bot, but an error occurred module 'io' has no attribute 'BytesID' and I don't know how to fix it, please tell me the
code:
@client.command(aliases = ['me', 'my card', 'card'], description = "In development...")
async def LightCard(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.BytesID(response.content))
response = response. convert('RGBA')
response = response.sesize((100, 100), Image.ANTIALIAS)
img.paste(response, (15, 15,115, 115))
idraw = ImageDraw.Draw(img)
name = ctx.author.name
tag = ctx.author.discriminator
headline = ImageFont.truetype('arial.ttf', size = 20)
undertext = ImageFont.truetype('arial.ttf', size = 12)
idraw.text((145, 15), f'{name}#{tag}', font = headline)
idraw.text((145,50), f'ID: {ctx.author.id} ', font = undertext)
img.save('LightCard.png')
await ctx.send(file = discord.File(fp = 'LightCard.png'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question