caxinha
Installation
Canvas
Function | Params |
---|
triggered() | image |
affect() | image |
batslap() | image image2 |
beautiful() | image |
blur() | image level (optional) |
bnw() | image |
bolsonaro() | image |
brightness() | image amount |
circle() | image |
color() | color (optional) |
colorfy() | image color |
comunism() | image |
createQrCode() | text options = { background: 'hexColor', color: 'hexColor' } (optional) |
darkness() | image amount |
del() | image |
dither() | image |
facepalm() | image |
fuse() | image image2 |
gay() | image |
invert() | image |
jail() | image |
kiss() | image image2 |
magik() | image |
pixelate() | image |
replaceColor() | image r g b |
rip() | image |
rotate() | image angle (optional) |
sepia() | image |
stickbug() | image |
spank() | image image2 |
trash() | image |
threshold() | image amount (optional) |
wanted() | image |
wasted() | image |
Gif
Functions |
---|
cuddle() feed() hug() kiss() pat() poke() slap() tickle() |
Misc
Function | Params | Description |
---|
choose() | choices | Faz uma decisão por você. |
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. |
getRandomInt() | min max | Escolhe um número de acordo com o número mínimo e o máximo. |
randomCharacters() | length | Cria um texto com caracteres aleatórios. |
randomHex() | none | Retorna um código hexadecimal aleatório. |
removeAcents() | text | Remove acentos de um texto. |
shorten() | text length | Reduz o comprimento de um texto. |
uptime() | message | Mostra o uptime da sua aplicação. |
Canvas Examples
Triggered Example
const 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");
Affect Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!affect") {
let image = await Caxinha.canvas.affect(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "affect.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Batslap Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!batslap") {
let member = message.mentions.users.first()
if(!member) return message.channel.send("Mencione alguém")
let image = message.author.displayAvatarURL({ dynamic: false, format: 'png' })
let image2 = member.displayAvatarURL({ dynamic: false, format: 'png' })
let attach = await Caxinha.canvas.batslap(image, image2);
let attachment = new Discord.MessageAttachment(attach, "batslap.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Beautiful Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!beautiful") {
let image = await Caxinha.canvas.beautiful(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "beautiful.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Blur Example
const 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");
Bnw Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!bnw") {
let image = await Caxinha.canvas.bnw(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "bnw.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Bolsonaro Example
const 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");
Brightness Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!brightness") {
let amount = 100
let image = await Caxinha.canvas.brightness(message.author.displayAvatarURL({ dynamic: false, format: 'png' }), amount);
let attachment = new Discord.MessageAttachment(image, "brightness.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Circle Example
const 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");
Color Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!color") {
let color = "#8572da";
let image = await Caxinha.canvas.color(color);
let attachment = new Discord.MessageAttachment(image, "color.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Colorfy Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!colorfy") {
let image = message.author.displayAvatarURL({ dynamic: false, format: 'png' })
let color = "#8572da";
let image = await Caxinha.canvas.colorfy(image, color);
let attachment = new Discord.MessageAttachment(image, "colorfy.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Comunism Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!comunism") {
let image = await Caxinha.canvas.comunism(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "comunism.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
createQrCode Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!createqrcode") {
let text = 'www.youtube.com/watch?v=dQw4w9WgXcQ'
let image = await Caxinha.canvas.createQrCode(text);
let attachment = new Discord.MessageAttachment(image, "createqrcode.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Darkness Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!darkness") {
let amount = 100
let image = await Caxinha.canvas.darkness(message.author.displayAvatarURL({ dynamic: false, format: 'png' }), amount);
let attachment = new Discord.MessageAttachment(image, "darkness.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Del Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!del") {
let image = await Caxinha.canvas.del(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "del.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Dither Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!dither") {
let image = await Caxinha.canvas.dither(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "dither.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Facepalm Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!facepalm") {
let image = await Caxinha.canvas.facepalm(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "facepalm.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Fuse Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!fuse") {
let member = message.mentions.users.first()
if(!member) return message.channel.send("Mencione alguém")
let image = message.author.displayAvatarURL({ dynamic: false, format: 'png' })
let image2 = member.displayAvatarURL({ dynamic: false, format: 'png' })
let attach = await Caxinha.canvas.fuse(image, image2);
let attachment = new Discord.MessageAttachment(attach, "fuse.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Gay Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!gay") {
let image = await Caxinha.canvas.gay(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "gay.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Invert Example
const 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");
Jail Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!jail") {
let image = await Caxinha.canvas.jail(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "jail.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Kiss Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!kiss") {
let member = message.mentions.users.first()
if(!member) return message.channel.send("Mencione alguém")
let image = message.author.displayAvatarURL({ dynamic: false, format: 'png' })
let image2 = member.displayAvatarURL({ dynamic: false, format: 'png' })
let attach = await Caxinha.canvas.kiss(image, image2);
let attachment = new Discord.MessageAttachment(attach, "kiss.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Magik Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!magik") {
let image = await Caxinha.canvas.magik(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "magik.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Pixelate Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!pixelate") {
let image = await Caxinha.canvas.pixelate(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "pixelate.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
ReplaceColor Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!replaceColor") {
let r = "1";
let g = "100";
let b = "200";
let image = await Caxinha.canvas.replaceColor(message.author.displayAvatarURL({ dynamic: false, format: 'png' }), r, g,b);
let attachment = new Discord.MessageAttachment(image, "replaceColor.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Rip Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!rip") {
let image = await Caxinha.canvas.rip(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "rip.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Rotate Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!rotate") {
let angle = 10
let image = await Caxinha.canvas.rotate(message.author.displayAvatarURL({ dynamic: false, format: 'png' }), angle);
let attachment = new Discord.MessageAttachment(image, "rotate.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Sepia Example
const 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");
Stickbug Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!stickbug") {
let image = await Caxinha.canvas.stickbug(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "stickbug.mp4");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Spank Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!spank") {
let member = message.mentions.users.first()
if(!member) return message.channel.send("Mencione alguém")
let image = message.author.displayAvatarURL({ dynamic: false, format: 'png' })
let image2 = member.displayAvatarURL({ dynamic: false, format: 'png' })
let attach = await Caxinha.canvas.spank(image, image2);
let attachment = new Discord.MessageAttachment(attach, "spank.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Trash Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!trash") {
let image = await Caxinha.canvas.trash(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "trash.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Threshold Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!threshold") {
let image = await Caxinha.canvas.threshold(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "threshold.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Wanted Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!wanted") {
let image = await Caxinha.canvas.wanted(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "wanted.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Wasted Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!wasted") {
let image = await Caxinha.canvas.wasted(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));
let attachment = new Discord.MessageAttachment(image, "wasted.png");
return message.channel.send(attachment);
}
})
client.login("Your_Bot_Token_here");
Gif Examples
Cuddle Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!cuddle") {
let image = await Caxinha.gif.cuddle();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Feed Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!feed") {
let image = await Caxinha.gif.feed();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Hug Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!hug") {
let image = await Caxinha.gif.hug();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Kiss Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!kiss") {
let image = await Caxinha.gif.kiss();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Pat Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!pat") {
let image = await Caxinha.gif.pat();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Poke Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!poke") {
let image = await Caxinha.gif.poke();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Slap Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!slap") {
let image = await Caxinha.gif.slap();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Tickle Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!tickle") {
let image = await Caxinha.gif.tickle();
return message.channel.send(image);
}
})
client.login("Your_Bot_Token_here");
Misc Examples
Choose Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!choose") {
let choices = 'Caxinha, Loritta'
let choose = Caxinha.choose(choices)
console.log(choose)
}
})
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");
FormatSizeUnits Example
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");
getRandomInt Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!getRandomInt") {
let min = 1
let max = 10
let result = Caxinha.getRandomInt(min, max)
console.log(result)
}
})
client.login("Your_Bot_Token_here");
RemoveAcents Example
const 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");
Shorten Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!shorten") {
let text = 'A npm caxinha é a melhor npm de manipulção de imagem de todas!';
let length = '25';
let removedAcents = Caxinha.shorten(text, length)
console.log(removedAcents)
}
})
client.login("Your_Bot_Token_here");
RandomCharacters Example
const 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");
RandomHex Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!randomHex") {
let randomHex = Caxinha.randomHex()
console.log(randomHex)
}
})
client.login("Your_Bot_Token_here");
Uptime Example
const Discord = require("discord.js");
const client = new Discord.Client();
const Caxinha = require("caxinha");
client.on("message", async (message) => {
if (message.content === "!uptime") {
let uptime = Caxinha.uptime(message)
console.log(uptime)
}
})
client.login("Your_Bot_Token_here");