Skip to content

stefanpost268/DiscordBot

Repository files navigation

DiscordBot - discordjs

Introducing DiscordBot, a robust project meticulously crafted to revolutionize the way you remotely manage a plethora of services. At its core, DiscordBot is optimized to deliver unparalleled control over game servers, prominently featuring beloved titles such as Minecraft and FiveM.

Catering to both administrators and players alike, DiscordBot redefines the landscape of overseeing game servers by endowing you with effortless and comprehensive remote management capabilities. What truly sets DiscordBot apart is its remarkable adaptability, allowing users to seamlessly transition between diverse game servers without necessitating intervention from administrators.

Unlock a new realm of game server management possibilities with DiscordBot - where control meets convenience.

How to Get Started

To run the project you need to have node 18 or higher installed on your dev/dist machine.

  1. Installation: Begin by downloading the DiscordBot project:
  • git clone https://github.com/stefanpost268/DiscordBot.git
  1. Environment Setup: Navigate to the project folder and configure your environment variables:
  • cd ./discordbot
  • cp .env.example .env
  1. Development Mode: Launch the development server with Node.js:
  • npm install
  • npm run dev

Distribution

The distribution version of the DiscordBot project is aimed at being uses on the linux platform. Follow these steps to set up and distribute the project.

1. Check configuration in Development Mode

Before creating a distribution version, ensure that the settings are correctly configured in development mode.

2. Build the project

Run the following command to build the application:

  • npm run build

3. Download Node Packages

Navigate to the dist directory and install the necessary node packages:

  • cd ./dist
  • npm install

4. Run the Application

After installing the node packages, you can run the application using the following command:

  • node index.js

Docker Image Version Management

Docker images for this project are automatically built and published via GitHub Actions whenever changes are pushed to the repository. The workflow applies a versioning and tagging strategy to help you identify and use the correct image:

  • Versioned Tags: Each release is tagged with a version number (e.g., ghcr.io/discordbot:1.2.3).
  • Branch Tags:
    • The main branch also publishes a latest tag (e.g., ghcr.io/discordbot:latest).
    • The dev branch publishes a dev-latest tag (e.g., ghcr.io/discordbot:dev-latest).

How to Pull Images

  • For stable releases:
    docker pull ghcr.io/discordbot:<version>
    # or always get the latest stable
    docker pull ghcr.io/discordbot:latest
  • For development builds:
    docker pull ghcr.io/discordbot:dev-latest

Replace <version> with the desired version number.

Docker compose example

The following is an example to set up the DiscordBot in a Docker container.

services:
  discordbot:
    image: ghcr.io/stefanpost268/discordbot:latest
    container_name: discordbot
    working_dir: /usr/src/app
    command: node dist/index.js
    environment:
      - NODE_ENV=production
    env_file:
      - ./.env
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock  # Mount Docker socket
      - ./config:/usr/src/app/config  # Mount config folder

Tagging Logic

The CI workflow determines which tags to apply based on the branch:

  • On main: tags as both the version and latest.
  • On dev: tags as both the version and dev-latest.
  • On other branches: only the version tag is applied.

Versioning Examples

The project uses Semantic Versioning for Docker images:

  • Major (X.0.0): Breaking changes or significant new features. Example: ghcr.io/discordbot:2.0.0
    • Expect: Major new features, possible breaking changes, or significant refactors.
  • Minor (X.Y.0): Backwards-compatible feature additions or improvements. Example: ghcr.io/discordbot:1.3.0
    • Expect: New features, enhancements, or improvements that do not break existing usage.
  • Patch (X.Y.Z): Backwards-compatible bug fixes or small updates. Example: ghcr.io/discordbot:1.3.2
    • Expect: Bug fixes, security patches, or minor tweaks.
  • Development (dev-latest): Latest development build from the dev branch. Example: ghcr.io/discordbot:dev-latest
    • Expect: Experimental features, work-in-progress changes, or unstable builds not intended for production.

About

Discord Bot is a server management tool through discord with a base foundation to manage game servers etc.

Topics

Resources

Stars

Watchers

Forks

Packages