Unexpected token error when I do .addsubcommand

So when I do .addsubcommand it spits out an error for an unexpected token for the . At the start If anyone knows how to fix it and the code editor that I’m using is replit so yeah I’m trying to make a startup command for my Southwest Florida roleplay session bot and I have to do a at everyone ping so it alerts everyone in the server

To clarify, I’m on node.js version 18.16.1 and I do have discord.js. I don’t know what version that I have but yeah I know that I have discord.js

down below is going to be a screenshot of the error that I’m getting

Without seeing your code, we can only give very general debugging advice.
“Unexpected token” almost always actually means that you missed a character earlier on. Usually it’s a closing quote or bracket. Probably whatever that method is being called on is missing something. Presumably your code is something along the lines of

const somthing = new Thing().aMethod("some parameter").otherMethod(['parameter', 'array'])
...etc..
.addSubcommand(subcommand =>...

The previous entity in the chain before addSubcommand is probably where the syntax error is. Count your paretheses, brackets, quotes, and so on.

1 Like

As said we need to see your code. Link to your Replit if you still need help.

The docs have an example that might help with the syntax.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.