All Projects → HaileyBot → captcha-generator

HaileyBot / captcha-generator

Licence: GPL-3.0 license
An NPM package to generate captcha images that can be used in Discord bots or various other projects

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to captcha-generator

Fantasy football chat bot
GroupMe Discord and Slack Chatbot for ESPN Fantasy Football
Stars: ✭ 166 (+268.89%)
Mutual labels:  slack, slack-bot
Sactive Bot
😈 An extensible chat bot framework. sactive-bot is an evolution of the open source hubot project. - https://www.shipengqi.top/sactive-bot .
Stars: ✭ 212 (+371.11%)
Mutual labels:  slack, slack-bot
Secret Santa
🎅 The code behind Secret Santa, the holiday bot for Slack / Discord / Zoom
Stars: ✭ 170 (+277.78%)
Mutual labels:  slack, slack-bot
Lita Slack
A Slack adapter for Lita.
Stars: ✭ 138 (+206.67%)
Mutual labels:  slack, slack-bot
Discord-Channel-Moderator
❤️ Discord Moderation Bot that helps you filter commands, (allow) links or filter words in channels where they were not allowed. Script is Node.js based using discord.js built by @Refloow
Stars: ✭ 76 (+68.89%)
Mutual labels:  discord-js, discord-bots
Slick
Slick, a Slack bot in Go
Stars: ✭ 150 (+233.33%)
Mutual labels:  slack, slack-bot
Go Sarah
Simple yet customizable bot framework written in Go.
Stars: ✭ 188 (+317.78%)
Mutual labels:  slack, slack-bot
Botonomous
A PHP Framework For Creating Autonomous Slack Bots
Stars: ✭ 109 (+142.22%)
Mutual labels:  slack, slack-bot
Max-Bot
Max Bot is an open-source bot made in node-js with discord-js. It Has Commands from fun to moderator.
Stars: ✭ 27 (-40%)
Mutual labels:  discord-js, discord-bots
cs-wordpress-bouncer
CrowdSec is an open-source cyber security tool. This plugin blocks detected attackers or display them a captcha to check they are not bots.
Stars: ✭ 25 (-44.44%)
Mutual labels:  captcha, captcha-generator
Norrisbot
a Slack bot that kicks asses (roundhouse-kicks to be accurate...)
Stars: ✭ 134 (+197.78%)
Mutual labels:  slack, slack-bot
Server-Captcha
Protect Your Server From Automated Bots With Captcha Now !
Stars: ✭ 18 (-60%)
Mutual labels:  captcha, discord-js
Slack Block Builder
Lightweight, no-dependency JavaScript library for creating Slack Block Kit UIs, with a builder syntax, inspired by SwiftUI.
Stars: ✭ 129 (+186.67%)
Mutual labels:  slack, slack-bot
Php Slack Bot
Slack bot user written in PHP
Stars: ✭ 161 (+257.78%)
Mutual labels:  slack, slack-bot
Slack Sql
🎉 Bring SQL console to Slack
Stars: ✭ 115 (+155.56%)
Mutual labels:  slack, slack-bot
Chatskills
Run and debug Alexa skills on the command-line. Create bots. Run them in Slack. Run them anywhere!
Stars: ✭ 171 (+280%)
Mutual labels:  slack, slack-bot
Slacky
🐍 The BEST Slack Selfbot on GitHub | No Bot User, Acts Like It's You! ⭐️
Stars: ✭ 80 (+77.78%)
Mutual labels:  slack, slack-bot
Slack Machine
A sexy, simple, yet powerful and extendable Slack bot
Stars: ✭ 91 (+102.22%)
Mutual labels:  slack, slack-bot
Awesome Bots
The most awesome list about bots ⭐️🤖
Stars: ✭ 2,864 (+6264.44%)
Mutual labels:  slack, slack-bot
captcha-canvas
A captcha generator by using skia-canvas.
Stars: ✭ 40 (-11.11%)
Mutual labels:  captcha, captcha-generator

Captcha Generator

NPM version NPM downloads Dependencies
License FOSSA Status Code Coverage
GitHub Sponsors PayPal

Captcha Generator is a Node library for quickly and easily generating captcha images that can be used through an authorized bot to verify human users on a chat platform such as Slack or Discord.

Installation

Use the package manager npm to install Captcha Generator

npm i @haileybot/captcha-generator

Usage

Basic

// Import the module
const Captcha = require("@haileybot/captcha-generator");

// Create a new Captcha object
//  - Optional argument to specify image height (250 to 400px, default 250)
//    - Image width is 400px
//  - Returned object will contain 4 properties
//    - "PNGStream" is a stream object for the image file in PNG format
//    - "JPEGStream" is a stream object for the image file in JPEG format
//    - "dataURL" is a data URL containing the JPEG image data
//    - "value" is the 6 character code the image contains
let captcha = new Captcha();
console.log(captcha.value);

Save to file example

const path = require("path"),
	fs = require("fs"),
	Captcha = require("@haileybot/captcha-generator");

let captcha = new Captcha();
captcha.PNGStream.pipe(fs.createWriteStream(path.join(__dirname, `${captcha.value}.png`)));
captcha.JPEGStream.pipe(fs.createWriteStream(path.join(__dirname, `${captcha.value}.jpeg`)));

Discord Example

This example assumes you already have the core framework of a Discord Bot set up

const Captcha = require("@haileybot/captcha-generator");

// Use this function for blocking certain commands or features from automated self-bots
function verifyHuman(msg) {
	let captcha = new Captcha();
	msg.channel.send(
		"**Enter the text shown in the image below:**",
		new Discord.MessageAttachment(captcha.JPEGStream, "captcha.jpeg")
	);
	let collector = msg.channel.createMessageCollector(m => m.author.id === msg.author.id);
	collector.on("collect", m => {
		if (m.content.toUpperCase() === captcha.value) msg.channel.send("Verified Successfully!");
		else msg.channel.send("Failed Verification!");
		collector.stop();
	});
}

License

This project is licensed under GPL-3.0

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].