caxinha Installation
Canvas
Function
Params
Description
bolsonaro()
image
Cria uma imagem do bolsonaro olhando para a imagem desejada.
triggered()
image
Cria um gif triggered.
blur()
image
level(optional)
Borra uma imagem.
circle()
image
Deixa uma imagem circular.
greyscale()
image
Coloca o filtro preto e branco em uma imagem.
invert()
image
Inverte uma imagem.
sepia()
image
Coloca o filtro sépia em uma imagem.
Bolsonaro Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!bolsonaro" ) {
let image = await Caxinha. canvas. bolsonaro ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) ) ;
let attachment = new Discord. MessageAttachment ( image, "bolsonaro.png" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Triggered Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!triggered" ) {
let image = await Caxinha. canvas. triggered ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) ) ;
let attachment = new Discord. MessageAttachment ( image, "triggered.gif" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Blur Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!blur" ) {
let image = await Caxinha. canvas. blur ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) , 2 ) ;
let attachment = new Discord. MessageAttachment ( image, "blur.png" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Circle Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!circle" ) {
let image = await Caxinha. canvas. circle ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) ) ;
let attachment = new Discord. MessageAttachment ( image, "circle.png" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Greyscale Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!greyscale" ) {
let image = await Caxinha. canvas. greyscale ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) ) ;
let attachment = new Discord. MessageAttachment ( image, "greyscale.png" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Invert Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!invert" ) {
let image = await Caxinha. canvas. invert ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) ) ;
let attachment = new Discord. MessageAttachment ( image, "invert.png" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Sepia Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!sepia" ) {
let image = await Caxinha. canvas. sepia ( message. author. displayAvatarURL ( { dynamic : false , format : 'png' } ) ) ;
let attachment = new Discord. MessageAttachment ( image, "sepia.png" ) ;
return message. channel. send ( attachment) ;
}
} )
client. login ( "Your_Bot_Token_here" ) ;
Misc
Function
Params
Description
pagination()
type
message
pages
emojiList
timeout
Cria embeds com páginas.
formatSizeUnits()
bytes
Formata bytes para Yottabytes, Zettabytes, Exabytes, Petabytes, Terabytes, Gigabytes, Megabytes, Kilobytes, e Bytes.
removeAcents()
text
Remove acentos de um texto.
randomCharacters()
length
Cria um texto com caracteres aleatórios.
Constant
Params
Description
type
guild
dm
Determina o local em que o bot retornará o comando.
message
none
Recolhe as informações necessárias para o funcionamento do comando.
pages
embeds
Determina as embeds que serão utilizadas.
emojiList
emoji
emoji2
Determina os emojis que serão utilizados para trocar de página.
timeout
numbers
Determina o tempo em que as reações serão retiradas da mensagem.
const Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!pagination" ) {
const embed = new Discord. MessageEmbed ( )
. setTitle ( 'Title' )
. setDescription ( 'Description' )
const embed2 = new Discord. MessageEmbed ( )
. setTitle ( 'Title 2' )
. setDescription ( 'Description 2' )
const embed3 = new Discord. MessageEmbed ( )
. setTitle ( 'Title 3' )
. setDescription ( 'Description 3' )
const type = 'guild'
const pages = [ embed, embed2, embed3 ]
const emojiList = [ "⏪" , "⏩" ] ;
const timeout = '120000' ;
Caxinha. pagination ( type, message, pages, emojiList, timeout)
}
} )
client. login ( "Your_Bot_Token_here" ) ;
const Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!format" ) {
let format = Caxinha. formatSizeUnits ( 1000000000 )
console. log ( format)
}
} )
client. login ( "Your_Bot_Token_here" ) ;
RemoveAcents Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!removeacents" ) {
let text = "ã ê î ò û ń ž ş đ ģ ķ ł ý ț ř ç" ;
let removedAcents = Caxinha. removeAcents ( text)
console. log ( removedAcents)
}
} )
client. login ( "Your_Bot_Token_here" ) ;
RandomCharacters Exampleconst Discord = require ( "discord.js" ) ;
const client = new Discord. Client ( ) ;
const Caxinha = require ( "caxinha" ) ;
client. on ( "message" , async ( message ) => {
if ( message. content === "!randomCharacters" ) {
let length = 5 ;
let random = Caxinha. randomCharacters ( length)
console. log ( random)
}
} )
client. login ( "Your_Bot_Token_here" ) ;