Code:
@commands.command()
async def quoteit(self, message):
source_image = Image.open(message.attachment[0].url)
transparent_image = Image.open("transparent_image.png").resize(source_image.size)
mask = Image.open("quote_mask.png").size(source_image.size)
output_image = Image.composite(source_image, transparent_image, mask)
message_picture = disnake.File(output_image)
await message.send(file=message_picture)
Error:
File "F:\...\cogs\utils.py", line 13, in quoteit
source_image = Image.open(message.attachments[0].url)
^^^^^^^^^^^^^^^^^^^
AttributeError: 'Context' object has no attribute 'attachments'
Already tried attachment, attachments and still getting this error.
Command looks like:
.quoteit
*image*