Skip to main content

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 = discapty.Captcha("plain")  # Creating my plain captcha without code, if so, a random code is generated.
    # At this point, the code is generated randomly and can already be 
    # verified, but if we want an output of a generated captcha text/image, 
    # 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 = discapty.Captcha("wheezy")
    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 = 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DisCapTy-0.4.tar.gz (112.2 kB view details)

Uploaded Source

Built Distribution

DisCapTy-0.4-py3-none-any.whl (109.7 kB view details)

Uploaded Python 3

File details

Details for the file DisCapTy-0.4.tar.gz.

File metadata

  • Download URL: DisCapTy-0.4.tar.gz
  • Upload date:
  • Size: 112.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for DisCapTy-0.4.tar.gz
Algorithm Hash digest
SHA256 9dd666318cf4604c317ee9bbd7b49fccb5b857781de7e163ee7d898fff9e694e
MD5 62f03ac8875382c2529241932f35d5aa
BLAKE2b-256 52d1d46888a1be047ca8df34389afea8dd17c695b06606d2e0e7a8083463e65b

See more details on using hashes here.

File details

Details for the file DisCapTy-0.4-py3-none-any.whl.

File metadata

  • Download URL: DisCapTy-0.4-py3-none-any.whl
  • Upload date:
  • Size: 109.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for DisCapTy-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 afc47075b9bbb3c94891a77cbb6e7fba51e5c1fc4c22d0f3e5be993c80a0b2f4
MD5 6a822f070b6be1fea6a7746314fa98a5
BLAKE2b-256 eff37e14c80d564547945f9b2151cadcd46ccbb872e09ed04d77ec00cf107a89

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page