Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

217
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda