Open Astremy opened 4 years ago
Thanks for your informations.
I have change the script. Now the bot delete the captcha folder just after the captcha sending. You said to send directly the image content and do not save it, but it's create an error : TypeError: expected str, bytes or os.PathLike object, not PngImageFile.
I will search better to convert in a good format.
Here is an explaination for how to upload an image :
https://discordpy.readthedocs.io/en/latest/faq.html#how-do-i-upload-an-image
You can save to bytesio, https://stackoverflow.com/a/65496569/12107639 has more info about sending
https://github.com/Darkempire78/Raid-Protect-Discord-Bot/blob/1c3699b1eb38da638e35c3085ed7e3a640126e8b/Cogs/onJoin.py#L119
Here, you create a file to send your image, don't do that !
You can just send data, without use a file. Additionally, you delete the file only if the user have the correct answer in 120 s. Your bot will then automatically take up disk space until there is no more disk space left.