Note: These instructions assume you are running the project in a local environment. You can also deploy the project using the buttons above to run on Replit or deploy on Vercel.
-
Install dependencies
npm i
-
Get your Public Key
- Go to Discord Developer Portal
- Select your bot
- Open General Information from the sidebar
- Copy the Public Key
-
Setup Registrar
- Open
register.js
- Replace
"YOUR TOKEN HERE"
at line 10 with your token - Replace
"YOUR PUBLIC KEY"
at line 12 with your public key - Run:
npm run register
- Open
-
Setup main entrypoint
- Open
index.js
- Replace
"YOUR TOKEN HERE"
at line 10 with your token - Replace
"YOUR PUBLIC KEY"
at line 11 with your public key
- Open
-
Run your project
npm run start
-
Set up Local Tunnel (Optional)
If you are running the project on your local machine, you'll need a way for Discord to send interactions to it. A local tunneling service like ngrok creates a public URL that forwards traffic to your local server.
- First, make sure your project is running (from step 5).
- In a new terminal, start ngrok and tell it to tunnel to the port your bot is running on (e.g., port 3000):
ngrok http 3000
- ngrok will provide a Forwarding URL which will look something like https://abcdefg.ngrok.io. Copy this URL.
-
Set the Interactions Endpoint URL
- Go to Discord Developer Portal
- Select your bot
- Open General Information from the sidebar
- Paste the deploy URL or your ngrok Forwarding URL (from the previous step) into the Interactions Endpoint URL field.