Skip to content

discordhttps/nodejs-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup Guide

Run on Replit Deploy on Vercel


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.

  1. Install dependencies

    npm i
  2. Get your Public Key

  3. 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
  4. 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
  5. Run your project

    npm run start
  6. 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
  7. 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.

About

Example of discord.https with Nodejs runtime.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published