How do I create my first Node.js bot?
Set up a Node.js environment, import the project, and define the start command.
Bot hosting provides Node.js, a file manager and a console. The Discord token should be stored in an environment variable.
Step-by-step procedure
-
Prepare the project
Your repository should contain package.json, an entry file and a startup script.
-
Order a bot
Choose Bots, then select Node.js as the environment in the order form.
-
Import the files
Use the GitHub import or upload an archive without node_modules.
-
Add the token
Create a DISCORD_TOKEN variable in Startup or a .env file excluded from the repository.
-
Install and start
Run npm ci, then run the start script defined in package.json.