JSPM

  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q54953F
  • License MIT

Caxinha bot npm

Package Exports

  • caxinha

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (caxinha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

caxinha npm npm install size

Installation

NPM

Canvas

Function Params Description
bolsonaro() image Cria uma imagem do bolsonaro olhando para a imagem desejada.
triggered() image Cria um gif triggered.

Bolsonaro Example

const Caxinha = require("caxinha");
const { MessageAttachment } = require("discord.js");

module.exports = {
  name: "bolsonaro",
  run: async (client, message, args) => {

 let image = await Caxinha.canvas.bolsonaro(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));

 let attachment = new MessageAttachment(image, "bolsonaro.png");

 return message.channel.send(attachment);

}
}

Triggered Example

const Caxinha = require("caxinha");
const { MessageAttachment } = require("discord.js");

module.exports = {
  name: "triggered",
  run: async (client, message, args) => {

 let image = await Caxinha.canvas.triggered(message.author.displayAvatarURL({ dynamic: false, format: 'png' }));

 let attachment = new MessageAttachment(image, "triggered.gif");

 return message.channel.send(attachment);

}
}

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.

Pagination

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.

Pagination Example

const Discord = require('discord.js');
const Caxinha = require('caxinha');

module.exports = {
    name: 'pagination',
    run: async (client, message, args) => {
      
        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)

    }
}

FormatSizeUnits Example

const Caxinha = require('caxinha');

module.exports = {
    name: 'format',
    run: async (client, message, args) => {

    let format = Caxinha.formatSizeUnits(1000000000) // 1 GB

    console.log(format)

    }
}

RemoveAcents Example

const Caxinha = require('caxinha');

module.exports = {
    name: 'removeacents',
    run: async (client, message, args) => {

    let text = "ã ê î ò û ń ž ş đ ģ ķ ł ý ț ř ç";

    let removedAcents = Caxinha.removeAcents(text)

    console.log(removedAcents)

    }
}

RandomCharacters Example

const Caxinha = require('caxinha');

module.exports = {
    name: 'randomcharacters',
    run: async (client, message, args) => {

    let length = 5;

    let random = Caxinha.randomCharacters(length)

    console.log(random)

    }
}