1.0.2 • Published 6 years ago
discord.js-utility v1.0.2
Simple and easy to use utilty tool for discord.js.
$ npm i discord.js-utilityconst { paginate, progressbar } = require('discord.js-utility');const { paginate } = require('discord.js-utility');
const { Client, MessageEmbed } = require('discord.js');
const client = new Client();
client.on('message', message => {
const embed1 = new MessageEmbed()
.setDescription('This is the 1st page');
const embed1 = new MessageEmbed()
.setDescription('This is the 2nd page');
const pages = [ embed1, embed2 ];
const emoji = ['⬅', '➡']; // Optional. Defaults to ['⬅', '➡']
const time = 45000; // Optional. Must be milliseconds. Defaults to 60000
paginate(message, pages, emoji, time);
});const { progressbar } = require('discord.js-utility');
const { Client, MessageEmbed } = require('discord.js');
const client = new Client();
client.on('message', message => {
const value = 10; // The current value
const maxValue = 100; // The maximum value
const barSize = 15; // The size of the bar.
const text = ['▬', '-']; // Optional. The text the bar should show. Defaults to ['▬', '-']
const showPercentage = false; // Optional. Whether the bar should show percentage or not. Defaults to true;
const bar = progressbar(value, maxValue, barSize, text, showPercentage);
return message.channel.send(bar);
});