Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

238
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda