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

150
Vistas
Discord.js creating ticket when pressed reaction on embed not working

I'm trying to make a ticket system for my discord bot but I can't figure out why excatly this part of code isn't working. I'm using discord.js v13.

So basically I have made this embed with reaction which is meant to be pressed and bot creates new text channel.

Image

And here is my code for creating new ticket after pressing reaction on embed:

client.on('messageReactionAdd', async (reaction, user) => {
    if(user.partial) await user.fetch();
    if(reaction.partial) await reaction.fetch();
    if(reaction.message.partial) await reaction.message.fetch();

    if(user.bot) return;

    const ticketid = await settings.get(`${reaction.message.guild.id}-ticket`);

    if(!ticketid) return;

    if(reaction.message.id == ticketid && reaction.emoji.name == '🎫') {
        reaction.users.remove(user);

        reaction.message.guild.channels.create(`ticket-${user.username}`, {
            permissionOverwrites: [
                {
                    id: user.id,
                    allow: ["SEND_MESSAGES", "VIEW_CHANNEL"]
                },
                {
                    id: reaction.message.guild.roles.everyone,
                    deny: ["VIEW_CHANNEL"]
                }
            ],
            type: 'text'
        }).then(async channel => {
            channel.send({ embeds: [new MessageEmbed().setTitle("Sveicināts `<@${user.id}>`!").setDescription("Lai saņemtu palīdzību raksti šajā kanālā.").setColor("FFFA33")] })
        })
    }
});

Can someone please help me, I've been trying to make this work for days now.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

you need to use collector https://discord.js.org/#/docs/main/stable/class/Collector or check the guide https://discordjs.guide/popular-topics/collectors.html#basic-reaction-collector

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