1.1.6 • Published 6 years ago

replypages-discordjs v1.1.6

Weekly downloads
15
License
MIT
Repository
github
Last release
6 years ago

ReplyPages-discordjs

This module is used to make simple interfaces that you can flip through by adding and removing reactions.

The buttons are as follows:

Buttons

From there you can create large and small paged interfaces.

To get started:

const Discord = require('discord.js');
const replyPages = require('replypages-discordjs');

let client = new Discord.Client();

replyPages.createListener(client);

To send the interface you must use

Discord.Message.replyPages([ //Discord.Message is a typedef use a message that it replies to
    new Discord.RichEmbed().setTitle('1st'),
    new Discord.RichEmbed().setTitle('2nd'),
    new Discord.RichEmbed().setTitle('3rd'),
    new Discord.RichEmbed().setTitle('4th'),
    new Discord.RichEmbed().setTitle('5th')
]);

The above would respond with the following: response

A way to use it may continue as follows:

client.on('message', (message) => { //When a message is recived
    if (message.author.bot) return;
    if (message.message.content == '!guilds') { //if the message is "!guilds"
        let embeds = []; //create the array of embeds to be sent

        client.guilds.forEach(guild => { //Get all guilds
            let embed = new Discord.RichEmbed() //make the embed
                .setTitle(guild.name) //Add the name to the embed
            if (guild.iconURL) {
                embed.setImage(guild.iconURL) //add the icon if exists
            }
            embed.setFooter((embeds.length + 1) + '/' + client.guilds.size); //for first 1/<guildcount>
            embeds[embeds.length] = embed; //add the embed to the array
        }); //repeat to make an embed for every guild

        message.replyPages(embeds); //send the array of embeds using <message>.replyPages(<embed array>)
    }
});
1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago