Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!