Link to add to your server here.
Command name | Example |
---|---|
help |
|
counter |
|
meta |
|
profile |
|
steamid |
Set up the environment variables by copying over the text in .env.example
to .env
and fill out the missing variables.
Environment variable | Value |
---|---|
BOT_TOKEN |
Discord bot token |
BOT_URI |
Mongodb connection uri |
TEST_SERVER_ID |
Server id of the test server |
The reason a test server is required, is because global slash commands can take up to an hour to register across all guilds, whereas guild specific commands update immediately making it useful for testing.
Ensure that you have node and npm installed, and run
# Install dependencies
npm install
# Set up husky git hooks
npm run prepare
# Run the bot
npm run dev
TypeScript is used for the bot for better code checking, and documentation. You can find the classes in the src/types
folder, and interfaces for things such as the database, or OpenDota API in the src/types/interfaces
folder.
Script | Purpose |
---|---|
build |
Compiles the code into dist folder |
format |
Automatically formats the code using prettier |
lint |
Runs eslint on all TypeScript files, and fixes them if possible |
prepare |
Installs husky scripts for git hooks |
start |
Compiles the code and starts the bot |
dev |
Runs the TypeScript code using ts-node |
test |
Run tests inside test folder |
- The bot is named lonely bot after Lone Druid a Dota 2 hero who I spam too much.
- Heroku runs whatever code is on the master branch, and reloads the bot after an update, so try to reduce the number of commits to master, as each reload results in a short downtime.