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

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

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 Relatório

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 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