1.1.9 • Published 10 months ago

captcha-discordv2 v1.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Captcha Generator

This module generates a CAPTCHA image code. It is designed to be simple to use while providing the flexibility to adjust the CAPTCHA length and ensuring that the text is appropriately sized and centered within the image.

Installation

To install this package, run the following command in your terminal:

npm install captcha-discord

Usage

const { captchaCreate } = require('captcha-discord');

// Generates a CAPTCHA with 10 characters
const captcha = captchaCreate(10);
member.send(captcha);

Parameters

length (optional): Specifies the number of characters in the CAPTCHA. Default is 5 characters if not specified. The function automatically adjusts the length to a minimum of 5 and a maximum of 30 characters.

Adaptive Font Size

The font size within the CAPTCHA is adaptively adjusted according to the number of characters to ensure the text remains clear and fits within the bounds of the image. This makes the CAPTCHA robust against varying text lengths.

Error Handling

const { captchaCreate } = require('captcha-discord');

// Attempting to generate a CAPTCHA with too many or too few characters
const captcha = captchaCreate(35); // This will adjust the length to 30 characters
const smallCaptcha = captchaCreate(3); // This will adjust the length to 5 characters
1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago