mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
fix: guard against undefined footer before appending closed label
- MessageHandler pagination close handler was doing embed.footer.text += ... unconditionally — throws TypeError if the embed has no footer or footer.text is not a string - Now checks embed.footer exists and footer.text is a string before appending; falls back to initialising footer with just the closed label if not
This commit is contained in:
1 parent
e11c29ed25
commit
0048a33099
1 file changed
+6
-1
@@ -956,7 +956,12 @@ export class QueuePaginator {
|
|||||||
const closeSession = async () => {
|
const closeSession = async () => {
|
||||||
unobserve();
|
unobserve();
|
||||||
const embed = buildEmbed(state.page);
|
const embed = buildEmbed(state.page);
|
||||||
embed.footer.text += " • " + this._handler.t(guildId, "pagination.embed.sclosedTitle");
|
const closedLabel = this._handler.t(guildId, "pagination.embed.sclosedTitle");
|
||||||
|
if (embed.footer && typeof embed.footer.text === "string") {
|
||||||
|
embed.footer.text += " • " + closedLabel;
|
||||||
|
} else {
|
||||||
|
embed.footer = { text: closedLabel };
|
||||||
|
}
|
||||||
rawMsg.edit({ embeds: [embed] }).catch(() => {});
|
rawMsg.edit({ embeds: [embed] }).catch(() => {});
|
||||||
await clearReactions();
|
await clearReactions();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user