Overview
- This repository runs a Discord bot built on
discord.jsv14. The bot loads slash commands fromslashCommands/, message commands fromchannelMsgCommands/, and event handlers fromevents/.
Purpose
- This README contains all manual steps for development and deployment: required environment variables, how to obtain the Discord bot token, where to find
clientIdandguildId, and common troubleshooting steps.
Required environment variables (exact names)
CUBA_TOKEN(required) — Discord bot token from the Developer Portal. The code also acceptscubaTokenfor legacy/local use, but setCUBA_TOKENin deployment.PREFIX(required) — message command prefix used by the bot (example:!).CLIENT_ID(required when runningdeploy-commands.js) — Application (Client) ID from the Developer Portal.GUILD_ID(required when runningdeploy-commands.jsfor guild-scoped registration) — server (guild) ID for fast command deployment.
Where to get each value (manual steps)
-
Bot token (
CUBA_TOKEN) 🔑- Open https://discord.com/developers/applications and sign in.
- Create a new application or select your existing one.
- In the left menu click Bot → Add Bot (if not already added).
- In the Bot page locate the Token section. If you lost the token, click Reset Token — the new token will be shown after you click Reveal/Copy. Copy it immediately and store it securely.
- Important: the token is shown only at reveal/reset. The Developer Portal does not display the raw token afterwards.
- Do NOT add a
Botprefix. Use the raw token string.
-
Application ID (
CLIENT_ID) 🆔- In the Developer Portal select your application and open General Information.
- Copy the value labeled Application ID and use it as
clientId.
-
Guild ID (
GUILD_ID) 🏷️- In the Discord app (desktop/web) enable Developer Mode: User Settings → Advanced → Developer Mode ON.
- Right-click the server icon (left sidebar) for the server you control and choose Copy ID. Paste that value as
guildId.
Invite the bot to a server (manual)
- Use this invite URL (replace
<clientId>):https://discord.com/oauth2/authorize?client_id=<clientId>&scope=bot%20applications.commands&permissions=8 - Open the URL, select your server, and authorize the bot (you must have Manage Server or admin privileges).
Local development — quick start
- Create a
.envfile in project root (do NOT commit it). Example:
CUBA_TOKEN=your_bot_token_here
PREFIX=!
CLIENT_ID=YOUR_APPLICATION_ID
GUILD_ID=YOUR_GUILD_ID
- Install dependencies and run:
npm install
npm startDeploying slash commands (quick guild deploy)
deploy-commands.jsregisters slash commands to a single guild for fast testing. It requiresCUBA_TOKEN,clientId, andguildIdset in the environment:
node deploy-commands.js