Next.js Discord

Discord Forum

Discord.js and nextjs

Unanswered
BigJHN posted this in #help-forum
Open in Discord
Hello how can i connect discord.js and next without api. That is when i start server next js automatic start bot

16 Replies

node .
@BigJHN node .
so if you enter in your console node . the bot starts?
@BigJHN ?
Yes
Because this is plain node app
@BigJHN Because this is plain node app
u cant
unless u use a custom nextjs server
but that will remove some of the dynamic and caching features
@BigJHN Yes
you can do this by adding it to your script like this: (see attached).

Like that it will be automatically started, when the dev script (in this case) starts. Of course you can also add it to your start script, so it only starts when next js starts
@B33fb0n3 you can do this by adding it to your script like this: (see attached). Like that it will be automatically started, when the dev script (in this case) starts. Of course you can also add it to your start script, so it only starts when next js starts
first -> && will not work on windows, second his question wasn't correctly formatted. He should have said that that he already has an external project and he wants to start it in parallel without integrating it into the next app.
also him not replying to my answer makes this even more worse than it already is 😭
i literally replied 1 min later
@gin first -> && will not work on windows, second his question wasn't correctly formatted. He should have said that that he already has an external project and he wants to start it in parallel without *integrating* it into the next app.
&& works fine. And yes, I am on windows. Secondly most question here inside the help-forum are not correctly formatted.
how can i connect discord.js and
isn't discord.js an external library / project for you?

parallel without integrating it
it's now part of the script, not part of nextjs itself.
@BigJHN solved?