Kozak - multi-language, multipurpose discord bot created using discord.js, typescript, MongoDB and i18next
This bot is up and running! Try it!
- Over 15 commands
- Advanced logging system
- Ticket system
- Private voice channels on your server
- Online member counter
.env.example - Environment variables example
src/
├── @types/ - TypeScript declaration files
├── commands/ - Discord slash commands
├── components/
│ ├── subcommandGroups/ - Extracted subcommand groups to increase modularity
│ ├── subcommands/ - Extracted subcommands
│ ├── logs/ - Log messages (So called "Audit log messages")
│ ├── buttons/ - Button message component
│ └── context/ - Context menu commands
├── events/ - Discord events
├── functions/ - Reusable code
├── handlers/ - Handlers for commands/buttons/events/etc
├── lib/ - Initialize different services
│ ├── client.ts - Discord client
│ ├── i18next.ts - i18next
│ └── mongodb.ts - MongoDB
├── locales/ - Resources for localization
│ ├── en/
│ ├── uk/
│ ├── fr/
│ └── resources.ts - File to specify available resources
├── schemas/ - Mongoose schemas
└── index.ts - File to run an application
DISCORD_TOKEN
- Discord application secret token from Discord Developers dashboard | https://discord.com/developers/applications
DISCORD_CLIENT_ID
- Discord application ID (Aka. Discord bot id) | https://discord.com/developers/applications
MONGOURL
- MongoDB connection string | Probably starts with mongodb:// or mongodb+srv://
DEBUG
- Used in dev mode, prints some additional information at runtime
- Install NodeJS runtime
-
Install Yarn
npm i -g yarn
- Install Git
-
Clone source code with
git clone git@github.com:RomaDevWorld/Kozak-BOT.git
or however you like it -
Open cloned directory in terminal, and run
yarn install
to install the dependencies -
Rename
.env.example
to.env
and specify all the necessary values (Like Discord Token or MongoDB url) -
Build source code with
yarn build
-
Run the app
yarn start
- Install Docker engine on your system
-
Run command below after all the env variables
-e
:
sudo docker run \
--name bot \
--restart unless-stopped \
-e DISCORD_TOKEN='Your discord bot token' \
-e DISCORD_CLIENT_ID='Your discord bot client id' \
-e MONGOURL='MongoDB connection string'
romadevworld/cossackbot:latest
- Requires Docker Engine and Docker Compose Plugin installed
If you prefer using Docker Compose, you can spin up both MongoDB and CossackBot containers with a single command
Clone the entire repo
git clone git@github.com:RomaDevWorld/Kozak-BOT.git
or just docker-compose.yml
wget https://raw.githubusercontent.com/RomaDevWorld/Kozak-BOT/main/docker-compose.yml docker-compose.yml
Open file in a text editor, and change DISCORD_CLIENT_ID
and DISCORD_TOKEN
Run this command
docker compose up -d
Then check how bot is doing with docker logs bot