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

338
Views
Discord JS, mis usuarios pueden crear canales de boletos ilimitados cuando reaccionan al emoji

Los usuarios pueden crear canales de tickets ilimitados cuando reaccionan a 🎫 este emoji, ¿qué parte de mi secuencia de comandos me falta para que los usuarios solo puedan crear un ticket hasta que lo cierren de nuevo?

El ID de mi bot a continuación es: 701327880046510080

¡Cualquier ayuda sería apreciada! :)

 bot.on('messageReactionAdd', async (reaction, user, channel) => { if(user.partial) await user.fetch(); if(reaction.partial) await reaction.fetch(); if(reaction.message.partial) await reaction.message.fetch(); if(user.bot) return; let ticketid = await settings.get(`${reaction.message.guild.id}-ticket`); if(!ticketid) return; 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"] } ], type: 'text' }).then(async channel => { EMBED STUFF ..irrelevant. <-ignore this send.react("🔒") }) } if(reaction.emoji.name == '🔒'){ if(!reaction.message.channel.name.includes("ticket-")) return; reaction.users.remove(user); reaction.message.channel.delete() } })
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Agregue estas líneas a su código

 bot.on('messageReactionAdd', async (reaction, user, channel) => { if(user.partial) await user.fetch(); if(reaction.partial) await reaction.fetch(); if(reaction.message.partial) await reaction.message.fetch(); if(user.bot) return; let ticketid = await settings.get(`${reaction.message.guild.id}-ticket`); if(!ticketid) return; // add below here const existing = bot.channels.cache.find(c => c.name === `ticket-${user.username}`) if (existing) { return reaction.message.reply({ content: `You already have a ticket open, please close it first before creating a new one. See the ${existing} channel` }); } // add above here // rest of code
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!