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

242
Vistas
How to change this message to an code block message?

I want to change this part into a code block message

message.channel.send(`${client.player.getQueue(message).loopMode ? '(looped)' : ''}\nCurrent: **__${queue.playing.author} | ${queue.playing.title}__** \n\n` + (queue.tracks.map((track, i) => {
            return `**${i + 1})** ${track.author} - ${track.title} | ${track.requestedBy.username}`
        }).slice(0, 10).join('\n') + `\n\n${queue.tracks.length > 10 ? `And **${queue.tracks.length - 10}** more track(s)` : `   **This is the end of the queue!**`}`));

I tried but it's not working

Here's the full code

module.exports = {
    name: 'queue',
    aliases: ['q'],
    category: 'Music',
    utilisation: '{prefix}queue',

    execute(client, message) {

        const queue = client.player.getQueue(message);

        message.channel.send(`${client.player.getQueue(message).loopMode ? '(looped)' : ''}\nCurrent: **__${queue.playing.author} | ${queue.playing.title}__** \n\n` + (queue.tracks.map((track, i) => {
            return `**${i + 1})** ${track.author} - ${track.title} | ${track.requestedBy.username}`
        }).slice(0, 10).join('\n') + `\n\n${queue.tracks.length > 10 ? `And **${queue.tracks.length - 10}** more track(s)` : `   **This is the end of the queue!**`}`));
    },
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Since codeblocks have to be made with tripple `, you can just add them to the beginning and end like you normally do but escape them with a backslash so your normal string template doesnt end early:

message.channel.send(`\`\`\`${client.player.getQueue(message).loopMode ? '(looped)' : ''}\nCurrent: **__${queue.playing.author} | ${queue.playing.title}__** \n\n` + (queue.tracks.map((track, i) => {
            return `**${i + 1})** ${track.author} - ${track.title} | ${track.requestedBy.username}`
        }).slice(0, 10).join('\n') + `\n\n${queue.tracks.length > 10 ? `And **${queue.tracks.length - 10}** more track(s)` : `   **This is the end of the queue!**`}\`\`\``));
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