Discord.js and nextjs
Unanswered
BigJHN posted this in #help-forum
BigJHNOP
Hello how can i connect discord.js and next without api. That is when i start server next js automatic start bot
16 Replies
@BigJHN Hello how can i connect discord.js and next without api. That is when i start server next js automatic start bot
How do you start your bot regularly (with which command)?
BigJHNOP
node .
@BigJHN node .
so if you enter in your console
node . the bot starts?@BigJHN ?
BigJHNOP
Yes
Because this is plain node app
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
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 andisn't discord.js an external library / project for you?
parallel without integrating itit's now part of the script, not part of nextjs itself.
@BigJHN solved?