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"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.Pagination = void 0; exports.Pagination = void 0;
const discord_js_1 = require("discord.js");
class Pagination { class Pagination {
constructor(channel, pages, originalMessage, client, loopPages, message) { constructor(channel, pages, originalMessage, client, loopPages, message) {
this.loopPages = true; this.loopPages = true;
@ -21,7 +22,7 @@ class Pagination {
async setPage(page) { async setPage(page) {
if (this.pages.length < page + 1) { } if (this.pages.length < page + 1) { }
if (!this.message) { 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; }); .catch(() => { this.originalMessage.reply("There seemed to be a problem doing that..."); return this; });
if (tempm instanceof Pagination) { if (tempm instanceof Pagination) {
return this; 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 { export class Pagination {
channel: TextChannel; channel: TextChannel;
@ -30,7 +30,7 @@ export class Pagination {
if (this.pages.length < page + 1) {} if (this.pages.length < page + 1) {}
if (!this.message) { 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;}); .catch(() => {this.originalMessage.reply("There seemed to be a problem doing that..."); return this;});
if (tempm instanceof Pagination) {return this;} if (tempm instanceof Pagination) {return this;}
else {this.message = tempm;} else {this.message = tempm;}

Loading…
Cancel
Save