This project is a demonstration of serverless Discord Bot that uses IDKit to verify humans. Verified humans get a special role assigned which can then be used to manage special permissions.
For local development, you also will need ngrok. After you log in, you can reach the Setup & Installation section. There is an instruction on how to launch and configure ngrok
To create your own bot:
- Clone repo.
- Run
npm install
. - Run
npm run dev
. It will launch the app athttp://localhost:3000
. - Launch
ngrok
. - Run
ngrok http http://localhost:3000
. - After this ngrok shows you your tunneled link in the
Forwarding
field. It will be something likehttps://9469-93-87-199-13.eu.ngrok.io
. - Go to Discord Developer Portal.
- Press the
New Application
button, set the app name, apply policies, and pressCreate
. - At the
INTERACTIONS ENDPOINT URL
field paste.<Your NGROK tunneled url>/api/interactions
and pressSave
. - Create a
.env.local
file in your directory and fill it with envs from.env.local.example
. APPLICATION ID
andPUBLIC KEY
you can find in theGeneral Information
section on Discord Dev Portal.- To get a bot token:
- go to the
Bot
section - Press
Add bot
- Press
Reset Token
- Token will be visible after this
- go to the
- Go to OAuth2 -> General -> Redirects -> add
<localhost or NGROK tunneled address>/api/auth/callback/discord
- On the landing page press
Install now
button. - Install bot.
- Try the
/verify
command.