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

220
Views
ReferenceError: reload is not defined

Basically my first error was TypeError: require(...) is not a function, so I immediately put a ; at the end of require("./handlers/slashcommands"). But then I come home with this error: ReferenceError: reload is not defined. This is after I put ; after my requirment. I'm mainly worrying about this part:

client.slashcommands = new Discord.Collection()

client.loadSlashCommands = (bot, reload) => require("./handlers/slashcommands");
(bot, reload)
client.loadSlashCommands(bot, false)

Any help would be appreciated!

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

(bot, reload), by itself, is nonsense (and you get the error because bot and reload are arguments to the arrow function, so when you move (bot, reload) outside it, the variable isn't available).

It is supposed to call the function returned by require(...).

Take the semi-colon back out:

(bot, reload) => require("./handlers/slashcommands")(bot, reload);

Then you need to address the real problem, which is that the slashcommands module is supposed to export a function, but currently doesn't.

about 4 years ago · Santiago Gelvez 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!