A Discord bot that only uses slash commands.
pnpm install
.env
, and add these valuesnpm run build
npm run setup-play-dl
, and follow the shown instructionsnpm run start
BOT_TOKEN
The token of the bot. Available in the Discord developer portal.
BOT_CLIENT_ID
The client ID of the bot. Only required to delete the slash command registry
OWNER_USER_IDS
The user id of the owner(s).
Separate multiple owners with a comma.
It should look like this:
689607114011705439,123456789012345678
Adding spaces before and after the comma should work too.
To get someones user id, enable developer mode in your Discord settings, and right click on the user. You should see an option called
Copy ID
.
CREATE_HTTP_SERVER
Useful if you are hosting the bot on an online service that automatically stops the bot after a short period of time, like Replit.
To use this, set the value to
true
. Any other value will not create the HTTP server.
Your .env file should look like this:
BOT_TOKEN = NzIwNjA1ODE4MzgyMzE5Njk4.XuIadw.kjtUXvBOzzTxepM_R3y5eW7mBnc
BOT_CLIENT_ID = 720605818382319698
OWNER_USER_IDS = 689607114011705439
# Optional
CREATE_HTTP_SERVER = true