We keep it simple. Here are the core packages driving this bot:
- discord.js (v14): The main library for interacting with the Discord API.
- dotenv: Keeps your secrets (like tokens) safe and out of your code.
- nodemon (Dev): Automatically restarts your bot whenever you save a file, so you don't have to do it manually.
Getting this up and running takes about 2 minutes.
Clone this repo to your machine:
git clone https://github.com/HaskaZuki/TemplateBot.git
cd TemplateBotRun this command to install the packages listed above:
npm installYou'll see a file called .env.example. Rename it to just .env and paste your bot token and client ID inside.
DISCORD_TOKEN=your_token_goes_here
CLIENT_ID=your_client_id_goes_hereNote: Never share your
.envfile with anyone!
Before you start, you need to tell Discord about your slash commands. We have a script for that:
npm run deployYou're ready to go.
npm startWorking on new features? Use npm run dev to watch for changes automatically.
commands/: Drop your new command files here. We use subfolders (likeutility) to keep things organized.events/: Listen for things likereadyorinteractionCreatehere.index.js: The entry point. It handles the dynamic loading magic.
If you encounter any issues or want to reach out directly, feel free to join our community or add me on Discord.
Discord Username:
zuki96_