factory-util
v1.0.44
Published
A package to help you with your projects.
Downloads
4
Maintainers
Readme
A library to help you while building your Discord Bot.
Instalation:
npm install factory-util
yarn add factory-util
pnpm add factory-util
Main Functions:
randomNumber(max, min) //Número aleatório entre max e min
randomText(text) //String aleatório entre uma Array
bestMatch(mainString, Matches) //Decide qual string de uma array é mais parecida com mainString
isLink(link) //Retorna true se uma string for um link, false se não.
rowBuilder(component) //Cria um ActionRow do Discord de forma simples
BuildEmbed(title, description, color, footer) //Cria uma Embed do Discord de forma simples
Usage
const factoryUtil = require("factory-util");
factoryUtil.randomNumber(10, 1) //Return a random number beetween 1 and 10
factoryUtil.randomText(["Mac", "Cam", "Acm"]) //Return a random string from the elements of the array.
factoryUtil.isLink("https://google.com") //true
factoryUtil.isLink("macxyz") //false
factoryUtil.isImage("https://media.discordapp.net/attachments/1154206069397131344/1163935758319628399/15_Sem_Titulo_20231017172249.png?ex=654162a5&is=652eeda5&hm=907ffed12fb2774bd723b41b8c3e871117825b6e8d5405e84752b7b29cc63208&"); //true
factoryUtil.isImage("macxyz"); //false
factory.bestMatch("Pizza", [ "Azzip", "Pizzq", "Lipza" ]) // { ratings: number, bestMatch: string, bestMatchIndex: number }