diff --git a/util/pagination.d.ts b/util/pagination.d.ts index a659205..e21ece0 100644 --- a/util/pagination.d.ts +++ b/util/pagination.d.ts @@ -24,6 +24,7 @@ export declare class Pagination { user?: 'any' | string; }): Promise; stop(): Promise; + getCurrentPage(): MessageEmbed; } interface ExtraControls { } diff --git a/util/pagination.js b/util/pagination.js index dbfe0e5..3bf1676 100644 --- a/util/pagination.js +++ b/util/pagination.js @@ -116,7 +116,7 @@ class Pagination { this.controllers.collector.stop(); let fe = this.message.embeds[0]; fe.setDescription(`${fe.description}\n\n*This menu has ended, start a new one to interact with it!*`); - fe.setFooter(`${fe.footer.text} | Menu ended`, this.client.user.avatarURL()); + fe.setFooter(`${fe.footer && fe.footer.text && fe.footer.text.length ? ` | ${fe.footer.text}` : ''}Menu ended`, this.client.user.avatarURL()); await this.message.edit({ embeds: [fe] }); clearInterval(this.timeoutInterval); return this; @@ -132,5 +132,6 @@ class Pagination { return await this.endControllers(); } ; + getCurrentPage() { return this.pages[this.currentPage]; } } exports.Pagination = Pagination; diff --git a/util/ts/pagination.ts b/util/ts/pagination.ts index 5833c0e..41fd072 100644 --- a/util/ts/pagination.ts +++ b/util/ts/pagination.ts @@ -146,6 +146,8 @@ export class Pagination { return await this.endControllers(); }; + public getCurrentPage(): MessageEmbed {return this.pages[this.currentPage];} + }