No description
Find a file
2025-08-21 13:33:17 +02:00
commands feat(command): do not use new components 2025-08-21 13:33:17 +02:00
config feat(command): do not use new components 2025-08-21 13:33:17 +02:00
exp Merge branch 'main' into refactor/config-command 2025-08-21 13:26:17 +02:00
user Merge branch 'main' into refactor/config-command 2025-08-21 13:26:17 +02:00
.dockerignore ci(docker): missing data folder in dockerignore 2024-04-27 18:39:36 +02:00
.env.example build(deps): update to gokord 0.5.0 2024-05-03 11:36:50 +02:00
.gitignore feat(xp): increase precision of timestamp 2025-08-18 13:56:32 +02:00
config.go feat(db): disable redis and use local map to store values 2025-05-21 18:46:27 +02:00
Dockerfile fix(db): wrong relation and bad where condition 2025-05-13 16:52:04 +02:00
events.go build(gokord): upgrade to latest version 2025-08-06 02:22:06 +02:00
go.mod build(gokord): use latest snapshot 2025-08-06 16:42:36 +02:00
go.sum build(gokord): use latest snapshot 2025-08-06 16:42:36 +02:00
les-copaings-bot.service fix(service): cannot escape ' in description 2025-03-05 14:51:36 +01:00
LICENSE Initial commit 2024-04-14 14:04:03 +02:00
main.go Merge branch 'main' into refactor/config-command 2025-08-21 13:26:17 +02:00
PRIVACY.md refactor(gorm): remove ...At fields from model 2025-05-13 13:15:59 +02:00
README.md feat(db): disable redis and use local map to store values 2025-05-21 18:46:27 +02:00
restart.sh build(gokord): upgrade to 0.7.0 2025-05-21 17:28:18 +02:00
updates.json refactor(command): use message component to edit config 2025-07-30 21:57:05 +02:00

Les Copaings Bot

Bot for the private server Discord "Les Copaings"

Features

  • Levels & XP
  • Roles management
  • Purge command

CopaingXPs

Functions:

  • xp-message(x;y) = 0.025 x^{1.25}\sqrt{y}+1 where x is the length of the message and y is the diversity of the message (number of different rune)
  • xp-vocal(x)=0.01 x^{1.3}+1 where x is the time spent in vocal (in second)
  • level(x)=0.2 \sqrt{x} where x is the xp
  • level^{-1}(x)=25x^2 where x is the level

Installation

There are two ways to install the bot: docker and build.

Docker

  1. Clone the repository
$ git clone https://github.com/anhgelus/les-copaings-bot.git
  1. Go into the repository, rename .env.example into .env and customize it: add your token, change the user and the password of the database
  2. Start the compose file
$ docker compose up -d --build

Now you have to edit config/config.toml. You can understand how this config file works below. After editing this file, you have to start again the bot. Every time you edit this file, you must restart the bot.

You can stop the compose file with docker compose down

Build

  1. Clone the repository
$ git clone https://github.com/anhgelus/les-copaings-bot.git
  1. Install Go 1.24+
  2. Go into the repository and build the program
$ go build . 
  1. Run the application through bash (or PowerShell if you are on Windows)

Now you have to edit config/config.toml. You can understand how this config file works below. After editing this file, you have to start again the bot. Every time you edit this file, you must restart the bot.

Config

The main config file is config/config.toml.

The default configuration is

debug = false
author = "anhgelus"

[database]
host = "localhost"
user = ""
password = ""
db_name = ""
port = 5432
  • debug is true if the bot is in debug mode (don't turn it on unless you are modifying the source code)
  • author is the author's name
  • [database].host is the host of postgres (using docker, it's postgres)
  • [database].user is the user of postgres to use (using docker, it must be the same value as POSTGRES_USER in .env)
  • [database].password is the user's password of postgres to use (using docker, it must be the same value as POSTGRES_PASSWORD in .env)`
  • [database].db_name is the postgres's database name to use (using docker, it must be the same value as POSTGRES_DB in .env)
  • [database].port is the port of postgres to use (using docker, it's 5432)

Technologies

  • Go 1.24
  • anhgelus/gokord