An easy generator of Captcha for Discord bots, creating embeds and images.
Project description
DisCaPty
The super hard-to-use module to make your super-hard-coded captcha image for Discord.py.
DisCaPty is a super generator for creating captcha images/text and embed for your server.
Installing
DisCaPty is available on PyPi!
python -m pip install -U discapty
unless you want the git method
python -m pip install -U git+https://github.com/Predeactor/discapty
Creating your captcha
You can opt for 3 differnts types of captcha. There is "plain", "image" and "wheezy". Plain is text, the text is "coded" to be sure the user cannot copy and paste the code, meaning he is obligated to rewrite it.
import discapty
async def testme():
my_captcha = discapty.Captcha("plain") # Creating my plain captcha without code, if so, a random code is generated.
# At this point, the code is generated and can already be
# verified, but if we want an output of a generated captcha,
# use my_captcha.generate_captcha.
await my_captcha.verify_code(str("SXCU")) # True
As long as you use "plain" type, you should receive string as the output of discapy.Captcha.generate_captcha
, but when it comes to "image" and "wheezy", we receive BytesIO objects.
import discapty
async def generate():
my_captcha = discapty.Captcha("wheezy")
my_image = await my_captcha.generate_captcha(str("SXCU"))
# <_io.BytesIO object at XxXXX>
If you just want to create an embed to send when challenging your member, there is a function for that.
import discapty
async def sendcaptcha():
my_captcha = discapty.Captcha("image")
my_embed: dict = await my_captcha.generate_embed(str("Red - Discord Bot"), title=str("Verification of my Discord server!!!"))
await ctx.channel.send(embed=my_embed["embed"], file=my_embed["image"])
# We use a dict since we may send an image with our embed with the message to get included.
Contact
There is no real support for this package, I made to make my life easier with my cogs, but feel free to open an issue, or a pull request.
I'll be more than happy to review.
My E-mail is predeactor0@gmail.com
in case you need it.
My Discord is Capitaine Predeactor#0495
Yes, the docs isn't very... impressive...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file DisCapTy-0.3.tar.gz
.
File metadata
- Download URL: DisCapTy-0.3.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4051d05da38e6138bc9e7ef2fdaceee7a5288407aa7fac54e241eb42f214023f |
|
MD5 | 3b8b16eb7d9098f4ead98c333f084040 |
|
BLAKE2b-256 | 7888bcca6ef977a84293a7ce9a05d378c4122a98632428f25c9627edfc54c511 |
File details
Details for the file DisCapTy-0.3-py3-none-any.whl
.
File metadata
- Download URL: DisCapTy-0.3-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef59064c3ad8c50dce3880fc14e8bbc0fb7c71f7438995a860ac1f56edad5e09 |
|
MD5 | d395ba6378483ddd408c9f9c40b4cb23 |
|
BLAKE2b-256 | dbddab5ef532ca63e6788559e2f231685deaf6c1d99174109e2551c14028bb76 |