From 36ff682e742021918d134ff91a2bee3041b5a2b9 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Sat, 23 Oct 2021 18:09:55 -0400 Subject: a ton of bug fixes --- src/lib/common/ButtonPaginator.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/lib/common') diff --git a/src/lib/common/ButtonPaginator.ts b/src/lib/common/ButtonPaginator.ts index 68955cc..6d4c49a 100644 --- a/src/lib/common/ButtonPaginator.ts +++ b/src/lib/common/ButtonPaginator.ts @@ -85,7 +85,7 @@ export class ButtonPaginator { } protected async collect(interaction: MessageComponentInteraction) { - if (interaction.user.id !== this.message.author.id || !client.config.owners.includes(interaction.user.id)) + if (interaction.user.id !== this.message.author.id && !client.config.owners.includes(interaction.user.id)) return await interaction?.deferUpdate().catch(() => undefined); switch (interaction.customId) { @@ -118,12 +118,14 @@ export class ButtonPaginator { } protected async end() { - if (!this.deleteOnExit) - return await this.sentMessage!.edit({ - content: this.text, - embeds: [this.embeds[this.curPage]], - components: [this.getPaginationRow(true)] - }).catch(() => undefined); + if (this.sentMessage && !this.sentMessage.deleted) + return await this.sentMessage + .edit({ + content: this.text, + embeds: [this.embeds[this.curPage]], + components: [this.getPaginationRow(true)] + }) + .catch(() => undefined); } protected async edit(interaction: MessageComponentInteraction) { -- cgit