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

215
Vistas
Discord.js | JSON - Ticket system, bot does not create ticket channel

my bot is not creating a ticket channel when a user is reacting to the emoji, the bot is only creating a ticket channel when I give my bot administrator rights within discord role itself.

What could be wrong in my code when user reacts to the emoji? Something missing, or permissions missing below? My bots ID 701327880046510080

And btw. on my discord I have given my bot all rights, but not administrator rights at the bottom of roles permissions.

Any help would be appreciated!

if(reaction.message.id == ticketid && reaction.emoji.name == '🎫') {
            reaction.users.remove(user);
            const ticketChannel = reaction.message.guild.channels.cache.find(chan => chan.name === `ticket-${user.username}`)
            if (ticketChannel) return;
            reaction.message.guild.channels.create(`ticket-${user.username}`, {
                parent: '701254271861260389',
                position: 1,
                permissionOverwrites: [
                    {
                        id: '701327880046510080',
                        allow: ["MANAGE_CHANNELS", "MANAGE_GUILD", "MANAGE_ROLES", "MANAGE_EMOJIS", "READ_MESSAGE_HISTORY", "MANAGE_MESSAGES", "SEND_MESSAGES", "VIEW_CHANNEL"]
                    },
                    {
                        id: user.id,
                        allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"]
                    },
                    {
                        id: reaction.message.guild.roles.everyone,
                        deny: ["VIEW_CHANNEL"]
                    },
                    {
                        id: '306893721725829121',
                        allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"]
                    }
                ],
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

It is most defintely a permission problem as you said it only works when you give the bot admin. It could also be because of the snippet below, you are allowing the permission but then denying it to everyone.

{
 id: reaction.message.guild.roles.everyone,
 deny: ["VIEW_CHANNEL"]
 },
about 4 years ago · Juan Pablo Isaza Denunciar

0

Try this and let me know if/what errors you get with the await you will need to make sure that your listener is async so that may need to be added to code above this which based on the other question it should be.

if (reaction.message.id == ticketid && reaction.emoji.name == '🎫') {
    reaction.users.remove(user);
    const channelName = `ticket-${user.username}`;
    const ticketChannel = reaction.message.guild.channels.cache.find(chan => chan.name === channelName);
    if (ticketChannel) return;
    const newChannel = await reaction.message.guild.channels.create(channelName, {
        parent: '701254271861260389',
        position: 1,
        permissionOverwrites: [{
            id: reaction.message.guild.id,
            deny: ["VIEW_CHANNEL"],
        }, {
            id: user,
            allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
        }, {
            id: '306893721725829121',
            allow: ["SEND_MESSAGES", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY"],
        }, {
            id: '701327880046510080',
            allow: ["MANAGE_CHANNELS", "MANAGE_GUILD", "MANAGE_ROLES", "MANAGE_EMOJIS", "READ_MESSAGE_HISTORY", "MANAGE_MESSAGES", "SEND_MESSAGES", "VIEW_CHANNEL"]
        }],
    }).catch((error) => {
        console.log(error)
    });
    console.log(newChannel);
}

If the above fails it is likely a permission issue, just need to find out for sure what is preventing it.

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