pagination buggybois

master
Kit Kasune 3 years ago
parent 040c694747
commit 74f180e9c3
  1. 3
      util/pagination.js
  2. 4
      util/ts/pagination.ts

@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Pagination = void 0;
const discord_js_1 = require("discord.js");
class Pagination {
constructor(channel, pages, originalMessage, client, loopPages, message) {
this.loopPages = true;
@ -21,7 +22,7 @@ class Pagination {
async setPage(page) {
if (this.pages.length < page + 1) { }
if (!this.message) {
let tempm = await this.channel.send("One moment...")
let tempm = await this.channel.send({ embeds: [new discord_js_1.MessageEmbed().setDescription("One moment...")] })
.catch(() => { this.originalMessage.reply("There seemed to be a problem doing that..."); return this; });
if (tempm instanceof Pagination) {
return this;

@ -1,4 +1,4 @@
import {TextChannel, Message, MessageEmbed, Client, MessageReaction, ReactionCollector} from 'discord.js';
import {TextChannel, Message, MessageEmbed, Client, MessageReaction, ReactionCollector, DiscordAPIError} from 'discord.js';
export class Pagination {
channel: TextChannel;
@ -30,7 +30,7 @@ export class Pagination {
if (this.pages.length < page + 1) {}
if (!this.message) {
let tempm = await this.channel.send("One moment...")
let tempm = await this.channel.send({embeds: [new MessageEmbed().setDescription("One moment...")]})
.catch(() => {this.originalMessage.reply("There seemed to be a problem doing that..."); return this;});
if (tempm instanceof Pagination) {return this;}
else {this.message = tempm;}

Loading…
Cancel
Save