Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Cannot send an empty message on discord.js v13

Okay so, I downloaded an old plugin that works on discord.js V12 (discord-pagination) and I want it to work on V13 too, so what can I do?

When I'm trying to use my command it says Cannot send an empty message, the issue is in that code below.

const paginationEmbed = async (msg, pages, emojiList = ["⏪", "⏩"], timeout = 120000) => {
    if (!msg && !msg.channel) throw new Error("Channel is inaccessible.");
    if (!pages) throw new Error("Pages are not given.");
    if (emojiList.length !== 2) throw new Error("Need two emojis.");
    let page = 0;
    const curPage = await msg.channel.send(pages[page].setFooter(`Page ${page + 1} / ${pages.length}`));
    for (const emoji of emojiList) await curPage.react(emoji);
    const reactionCollector = curPage.createReactionCollector((reaction, user) => emojiList.includes(reaction.emoji.name) && !user.bot, { time: timeout });
    reactionCollector.on("collect", (reaction) => {
        reaction.users.remove(msg.author);
        switch (reaction.emoji.name) {
            case emojiList[0]:
                page = page > 0 ? --page : pages.length - 1;
                break;
            case emojiList[1]:
                page = page + 1 < pages.length ? ++page : 0;
                break;
            default:
                break;
        }
        curPage.edit(pages[page].setFooter(`Page ${page + 1} / ${pages.length}`));
    });
    reactionCollector.on("end", () => {
        if (!curPage.deleted) {
            curPage.reactions.removeAll();
        }
    });
    return curPage;
};
module.exports = paginationEmbed;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Guessing from your code, I think the problem is sending an embed.

message.channel.send(embed) // deprecated
message.channel.send({embeds: [embed] }) // V13 version

So for you you would have to change one line:

// change this
const curPage = await msg.channel.send(pages[page].setFooter(`Page ${page + 1} / ${pages.length}`));
// to this
const curPage = await msg.channel.send({ embeds: [pages[page].setFooter(`Page ${page + 1} / ${pages.length}`)] });

Same goes for curPage.edit:

// change this
curPage.edit(pages[page].setFooter(`Page ${page + 1} / ${pages.length}`));
// to this
curPage.edit({ embeds: [pages[page].setFooter(`Page ${page + 1} / ${pages.length}`)] });

Also you might want to give the Guide a read, on how to update from V12 to V13

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!