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

211
Views
TypeError: no se pueden leer las propiedades de undefined (leyendo 'editReply')

Estoy haciendo un bot con Discord.js y este es mi código:

 const { CommandInteraction, Interaction } = require("discord.js"); module.exports = { name: "test", description: "Tests the bot.", ephemeral: "false", permission: "SEND_MESSAGES", /** * * @param {CommandInteraction} interaction */ execute(interaction) { interaction.reply({content: "Testing..."}) .then(interaction => { setTimeout(function(){ interaction.editReply("Test Successful ✔") }, 3000) }) } }

Pero recibo un error en la terminal cuando intento iniciar el bot. Este es el error que me sale:

 C:\Users\Manuel\Desktop\Manuel\Programs\Programming\Visual Studio Code\Helix32 (Discord)\Commands\Developer\test.js:16 interaction.editReply("Test Successful ✔") ^ TypeError: Cannot read properties of undefined (reading 'editReply') at Timeout._onTimeout (C:\Users\Manuel\Desktop\Manuel\Programs\Programming\Visual Studio Code\Helix32 (Discord)\Commands\Developer\test.js:16:29) at listOnTimeout (node:internal/timers:557:17) at processTimers (node:internal/timers:500:7) Node.js v17.2.0 [nodemon] app crashed - waiting for file changes before starting...
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Debe establecer fetchReply en true para devolver el mensaje, pero realmente no es necesario... solo use la interacción original

 interaction.reply({content: "Testing..."}) .then(() => { //no "interaction" declaration setTimeout(function(){ interaction.editReply("Test Successful ✔") //use original interaction object }, 3000) })
about 4 years ago · Juan Pablo Isaza Report

0

Creo que está viendo esto porque no está recuperando la interacción de la llamada anterior. Si usa esto (incluida la bandera), debería ayudar:

 interaction.reply({ content: 'Pong!', fetchReply: true })

¡salud!

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!