devRael1 / discordjs-pagination

A pagination system for Discord.js v14
https://www.npmjs.com/package/@devraelfreeze/discordjs-pagination
MIT License
11 stars 10 forks source link

Footer text is not preserved #5

Closed mudkipscience closed 1 year ago

mudkipscience commented 1 year ago

As title says, the embed footer isn't being preserved when it is passed to this module.

Example code (the footer is replaced with Page 1/X)

embeds.push(new client.EmbedBuilder()
    .setTitle('Current Splatoon 3 Maps')
    .setColor(interaction.guild.members.me.displayHexColor)
    .addFields(
        {
            name: '<:turf_war:814651383911153692> Turf War',
            value: `${json.data.regularSchedules.nodes[0].regularMatchSetting.vsStages[0].name}\n${json.data.regularSchedules.nodes[0].regularMatchSetting.vsStages[1].name}`,
            inline: true
        },
        {
            name: `<:ranked:814651402479468544> Anarchy Series: ${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsRule.name}`,
            value: `${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[0].vsStages[1].name}`,
            inline: true
        },
        {
            name: `<:ranked:814651402479468544> Anarchy Open: ${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsRule.name}`,
            value: `${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsStages[0].name}\n${json.data.bankaraSchedules.nodes[0].bankaraMatchSettings[1].vsStages[1].name}`,
            inline: true
        },
        {
            name: `X rank: ${json.data.xSchedules.nodes[0].xMatchSetting.vsRule.name}`,
            value: `${json.data.xSchedules.nodes[0].xMatchSetting.vsStages[0].name}\n${json.data.xSchedules.nodes[0].xMatchSetting.vsStages[1].name}`,
            inline: true
        }
    )
    .setFooter({ text: `Maps changing in ${prettifyMiliseconds(new Date(json.data.xSchedules.nodes[0].endTime).getTime() - Date.now(), { secondsDecimalDigits: 0 })} - Data provided by splatoon3.ink`})
);
devRael1 commented 1 year ago

Hi, thank you for your feedback about this bug.

I just looked at it and yes, the footer is not added correctly. I will fix this bug in a few hours. An update will be made on the package.

devRael1 commented 1 year ago

Ok, I just patched the bug. Now the footer text is added correctly after the page number info.

The problem was just the verification system of the text in Object format.

You can download & use new version 2.6.8

mudkipscience commented 1 year ago

all fixed, thanks :)