Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda