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

462
Views
Error: No se puede encontrar el módulo './src/commands/ping.js'

No he tocado js en años, por lo que estoy bastante oxidado en términos de codificación en javascript. Si tienes respuestas, ¡no dudes en decirme y criticar! Dentro de ping.js

 const { SlashCommandBuilder } = require('@discordjs/builders'); module.exports = { data: new SlashCommandBuilder() .setName('ping') .setDescription('Replies with Pong!'), async execute(interaction) { return interaction.reply('Pong!'); }, };

en mi archivo bot.js

 client.commands = new Collection(); const commandFiles = fs.readdirSync('./src/commands').filter(file => file.endsWith('.js')); for (const file of commandFiles) { const command = require(`./src/commands/${file}`); client.commands.set(command.data.name, command); } client.on('interactionCreate', async interaction => { if (!interaction.isCommand()) return; const command = client.commands.get(interaction.commandName); if (!command) return; try { await command.execute(interaction); } catch (error) { console.error(error); await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true }); } });
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!