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

291
Vistas
DiscordJS: Create Thread for bot's own message

I want the bot to create a Thread to it's own message, but I cant figure out how to do that. I've managed to make it create a Thread to the user's message, but thats about it.

client.on('messageCreate', async message => {
    if(message.author.bot) return;

    if(message.channel.id == config.suggestChannelID) {
        const suggestEmbed = new MessageEmbed()
            .setColor('#FEE75C')
            .setTitle(`${message.content}`)
            .setAuthor({
                name: `${message.member.displayName}`,
                iconURL: `[REDACTED]`,
                url: `[REDACTED]`
            })
            .setTimestamp()
            .setFooter({
                text: 'SuggestManager',
                iconURL: '[REDACTED]',
            });

        const discussThread = await message.startThread({
            name: 'name',
            autoArchiveDuration: 60,
            type: 'GUILD_PUBLIC_THREAD',
            reason: 'test'
        });

        await message.reply({embeds: [suggestEmbed]}).then(sentEmbed => {
            sentEmbed.react("👍")
            sentEmbed.react("👎")
        });

        message.delete(message.id);
    };
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

added const threadAuthor to save the original message author & replaced sentEmbed with function (message)

client.on('messageCreate', async message => {
    if(message.author.bot) return;

    if(message.channel.id == config.suggestChannelID) {
        //added this
        const threadAuthor = message.member.displayName;

        const suggestEmbed = new MessageEmbed()
            .setColor('#FEE75C')
            .setTitle(`${message.content}`)
            .setAuthor({
                name: `${message.member.displayName}`,
                iconURL: `[REDACTED]`,
                url: `[REDACTED]`
            })
            .setTimestamp()
            .setFooter({
                text: 'SuggestManager',
                iconURL: '[REDACTED]',
            });
        
        //changed this
        await message.reply({embeds: [suggestEmbed]}).then(function (message) {
            message.react("👍")
            message.react("👎")
            message.startThread({
                name: `${threadAuthor}-${message.createdTimestamp}`,
                autoArchiveDuration: 60,
                type: 'GUILD_PUBLIC_THREAD'
            });
        });

        message.delete(message.id);
    };
});
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