Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send the captcha without saving it #1

Open
Astremy opened this issue Aug 21, 2020 · 3 comments
Open

Send the captcha without saving it #1

Astremy opened this issue Aug 21, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@Astremy
Copy link

Astremy commented Aug 21, 2020

image.save(f"{folderPath}/output/{captchaName}_2.png")

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.

@Darkempire78
Copy link
Owner

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.

@Astremy
Copy link
Author

Astremy commented Aug 22, 2020

Here is an explaination for how to upload an image :

https://discordpy.readthedocs.io/en/latest/faq.html#how-do-i-upload-an-image

@Darkempire78 Darkempire78 reopened this Apr 5, 2021
@Darkempire78 Darkempire78 changed the title Raid protection problem Send the captcha without saving it Apr 5, 2021
@Darkempire78 Darkempire78 added the enhancement New feature or request label Apr 5, 2021
@TheOnlyWayUp
Copy link

You can save to bytesio, https://stackoverflow.com/a/65496569/12107639 has more info about sending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants