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

228
Views
SyntaxError: Token inesperado 'const'

¿Cómo puedo resolver mi error en la línea 16 que es un error de sintaxis? ¿Alguien puede ayudarme a solucionarlo? Este es el 'controlador de comandos' para discord js.

 const { Events } = require("../Validation/Events"); const { promisify } = require("util"); const { glob } = require("glob"); const PG = promisify(glob); const Ascii = require("ascii-table"); module.exports = async (client) => { const Table = new Ascii("Events Loaded"); (await PG(`${process.cwd()}/Events/*/*.js`)).map(async (file) => { const event = require(file); if (event.name) { if(!Events.includes(event.name)) const L = file.split("/"); return Table.addRow(`${event.name || "MISSING"}`, `⛔ Event name is either invalid or missing ${L[6] + `/` + L[7]}`); } if(event.once) client.once(event.name, (...args) => event.execute(...args, client)); else client.on(event.name, (...args) => event.execute(...args, client)); await Table.addRow(event.name, "✔️ SUCCESSFUL") }); console.log(Table.toString()); }```
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Que es

 if(!Events.includes(event.name)) const L = file.split("/"); return Table.addRow(`${event.name || "MISSING"}`, `⛔ Event name is either invalid or missing ${L[6] + `/` + L[7]}`);

supone que debe hacer ?

Lo más probable es que quisiera agrupar esos

 if(!Events.includes(event.name)) { const L = file.split("/"); return Table.addRow(`${event.name || "MISSING"}`, `⛔ Event name is either invalid or missing ${L[6] + `/` + L[7]}`); }
about 4 years ago · Juan Pablo Isaza Report

0

Tu estas diciendo

 if(!Events.includes(event.name)) const L = file.split("/");

Lo cual no tiene sentido porque const tiene un alcance de bloque. Te olvidaste {}

 if (event.name) { if(!Events.includes(event.name)) { const L = file.split("/"); return Table.addRow(`${event.name || "MISSING"}`, `⛔ Event name is either invalid or missing ${L[6] + `/` + L[7]}`); } }
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!