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

202
Views
Intentando guardar en el canal quick.db después de la interacción, pero no puedo guardar el canal y evitar que se cree un canal

Estoy usando la biblioteca 'discord.js' v13 con el paquete npm 'quick.db'.

Estoy tratando de salvar el canal de la interacción, pero cuando lo hago por primera vez, el bot me envía que ya tengo el canal. Cuando intento por segunda y tercera vez, me envía el mismo mensaje y recrea un canal.

El código JavaScript que estoy usando:

 client.on('interactionCreate', async(interaction) => { if (interaction.customId === "general") { await interaction.deferUpdate(); const channel = await interaction.guild.channels.create(`name-${interaction.member.user.username}`, { type: 'GUILD_TEXT' }).then(async channel => { const del = new MessageButton() .setStyle("DANGER") .setLabel("🔒 Delete") .setCustomId("del"); const delbut = new MessageActionRow() .addComponents([ [del] ]) await channel.send({ content: `test`, embeds: [test], components: [delbut] }).catch(e => { console.log(e.message) }); const channelID = await interaction.guild.channels.cache.get(channel.id); const newchannel = await db.set(`channel_${interaction.guild.id}_${interaction.channel.id}`, interaction.member.id) if (newchannel) { const savedChannel = await db.get(`channel_${interaction.guild.id}_${interaction.channel.id}`) interaction.member.send({ content: `Channel: ${channelID}` }) } } }) if (interaction.customId === "del") { await interaction.deferUpdate(); interaction.message.channel.delete() } } });
about 4 years ago · Juan Pablo Isaza
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!