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.2.tar.gz
.
File metadata
- Download URL: DisCapTy-0.3.2.tar.gz
- Upload date:
- Size: 6.6 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.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1291a6797fa1e8c516803f5df064e9dc1db82a4da3ff9a576b0eb67043042d9 |
|
MD5 | d1ea980c1c8fe81544a696b72593fce8 |
|
BLAKE2b-256 | 72d4220794c568fda344b6c31fa9a585adf2c40d300269a08b24702708bd4783 |
File details
Details for the file DisCapTy-0.3.2-py3-none-any.whl
.
File metadata
- Download URL: DisCapTy-0.3.2-py3-none-any.whl
- Upload date:
- Size: 19.2 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.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a687cbae23d1ee85a16ccb562feb1327130b29bd78eea23a62325c68d46f3be |
|
MD5 | 6572c70c22c62eb4689b4ee0cfcb2a3d |
|
BLAKE2b-256 | 46f6e9a3102aac302b50783cef0cd2e654259c4e170dd01b28c741aad8c3df51 |