probot-captcha
v1.0.3
Published
generate probot captcha image
Downloads
27
Maintainers
Readme
What is probot-captcha ?
Package that can generate Probot captcha .
Installation
npm install probot-captcha
Usage
Generate Captcha With Random Numbers :
let generateCaptcha = require('probot-captcha');
client.on('messageCreate', async message => {
if (!message.guild) return;
if (message.author.bot) return;
if (message.content.toLowerCase().startsWith('captcha')) {
let cap = await generateCaptcha() // Must be awaited
message.reply({files: [cap.captcha]})
}
})
Generate Captcha With Custom String :
let generateCaptcha = require('probot-captcha');
client.on('messageCreate', async message => {
if (!message.guild) return;
if (message.author.bot) return;
if (message.content.toLowerCase().startsWith('captcha')) {
let cap = await generateCaptcha('12345') // Must be awaited
message.reply({files: [cap.captcha]})
}
})
Opject
let generateCaptcha = require('probot-captcha');
console.log(await generateCaptcha('12345'))
// => { captcha: { name: "captcha.png", attachment: buffer }, code: '12345' }