discord.js · /ping
A working slash-command bot with explicit registration and clean shutdown.
Files generated locally. No credentials needed to download.
Before you start
Node.js 22.9+ within the 22.x line, npm, a Discord application and your own test server.
Dependencies
- discord.js 14.27.0
Run locally
- 1
Run npm install. Keep the generated package-lock.json in your repository for repeatable installs.
- 2
Copy .env.example to .env on your computer and fill in the values. Install the bot in a test server with bot and applications.commands scopes, without Administrator permission.
- 3
Run npm run register:commands once, then npm start. Try /ping in the test server.
Environment checklist
DISCORD_TOKENRequired · secret- Bot token from the Discord Developer Portal. Never include it in a ZIP.
DISCORD_GUILD_IDRequired- ID of a test server you manage.
DISCORD_CLIENT_IDRequired- Application ID, not the client secret.
What is not included
Only the Guilds intent is needed. Registration upserts /ping in your test server. The website never contacts Discord or stores your token.
The configurator prepares files and settings. Confirm deployment, add your credentials in Environment and check Console to verify startup.
Official documentation
README.md
# discord.js · /ping
A working slash-command bot with explicit registration and clean shutdown.
## Requirements
Node.js 22.9+ within the 22.x line, npm, a Discord application and your own test server.
## Setup
1. Run npm install. Keep the generated package-lock.json in your repository for repeatable installs.
2. Copy .env.example to .env on your computer and fill in the values. Install the bot in a test server with bot and applications.commands scopes, without Administrator permission.
3. Run npm run register:commands once, then npm start. Try /ping in the test server.
## Variables
- DISCORD_TOKEN: Bot token from the Discord Developer Portal. Never include it in a ZIP.
- DISCORD_GUILD_ID: ID of a test server you manage.
- DISCORD_CLIENT_ID: Application ID, not the client secret.
## Boundaries
Only the Guilds intent is needed. Registration upserts /ping in your test server. The website never contacts Discord or stores your token.
Downloading does not deploy anything. The Botkeep preview stores files in your browser but does not execute processes, install packages or activate networking. Do not enter real credentials in the demo. Direct dependencies are versioned: keep generated lockfiles and review updates and vulnerabilities before production.
## Sources
- discord.js: https://discord.js.org/docs/packages/discord.js/14.27.0