Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- module.exports.run = (message, args, tools) => {
- let pages = ['General Commands Page 1', 'General Command Page 2', 'General Commands Page 3'];
- let page = 1;
- let embed03 = new Discord.RichEmbed()
- .setColor("#15f153")
- .setDescription(pages[page-1])
- .setFooter(`Page ${page} of ${pages.length}`)
- .addField("field 1")
- .addField("field 2")
- .addField("!field 3")
- .addField("field 4")
- message.channel.send(embed03).then(msg => {
- msg.react('⏪').then( r => {
- msg.react('⏩')
- // Filters
- const backwardsFilter = (reaction, user) => reaction.emoji.name === '⏪' && user.id === message.author.id;
- const forwardsFilter = (reaction, user) => reaction.emoji.name === '⏩' && user.id === message.author.id;
- const backwards = msg.createReactionCollector(backwardsFilter, {timer: 1000});
- const forwards = msg.createReactionCollector(forwardsFilter, {timer: 1000});
- backwards.on('collect', r => {
- if (page !== 1) {
- page--;
- embed03.setDescription(pages[page-1])
- embed03.setFooter(`Page ${page} of ${pages.length}`);
- msg.edit(embed03)
- }
- })
- forwards.on('collect', r => {
- if (page === pages.length) return;
- page++;
- embed.setDescription(pages[page-1]);
- embed.setFooter(`Page ${page} of ${pages.length}`);
- msg.edit(embed)
- })
- })
- })
- }
- module.exports.config = {
- name: "items",
- aliases: ["items"],
- usage: "item",
- description: "",
- accessableby: "Members"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement