Coder Social home page Coder Social logo

romadevworld / kozak-bot Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 440 KB

Multi-language, multipurpose discord bot created using discord.js, typescript, MongoDB and i18next

License: MIT License

JavaScript 0.10% TypeScript 99.79% Dockerfile 0.12%
discordbot discordjs-v14 i18next mongoose multilanguage multipurpose-discord-bot typescript docker

kozak-bot's Introduction

Kozak - multi-language, multipurpose discord bot created using discord.js, typescript, MongoDB and i18next

This bot is up and running! Add it to your server

Featuring:

  • Over 15 commands
  • Advanced logging system
  • Ticket system
  • Private voice channels on your server
  • Online member counter

Folder structure explanation

.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

Understanding env variables

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

How to run it?

Locally with Node.JS

  1. Install NodeJS runtime
  2. Install Yarn npm i -g yarn
  3. Install Git
  4. Clone source code with git clone [email protected]:RomaDevWorld/Cossack-BOT.git or however you like it
  5. Open cloned directory in terminal, and run yarn install to install the dependencies
  6. Rename .env.example to .env and specify all the necessary values (Like Discord Token or MongoDB url)
  7. Build source code with yarn build
  8. Run the app yarn start

Using Docker

  1. Install Docker engine on your system
  2. 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

Docker Compose

  • 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 [email protected]:RomaDevWorld/Cossack-BOT.git

or just docker-compose.yml

wget https://raw.githubusercontent.com/RomaDevWorld/Cossack-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

kozak-bot's People

Contributors

bimoware avatar dependabot[bot] avatar romadevworld avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.