{"id":21674304,"url":"https://github.com/anhgelus/les-copaings-bot","last_synced_at":"2025-04-12T04:22:19.212Z","repository":{"id":233278323,"uuid":"786417513","full_name":"anhgelus/les-copaings-bot","owner":"anhgelus","description":"Bot for the private server Discord \"Les Copaings\". Adds a nice XP to Discord.","archived":false,"fork":false,"pushed_at":"2024-05-03T09:39:44.000Z","size":155,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-03T14:13:03.132Z","etag":null,"topics":["bot","discord","discord-bot","discordgo","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anhgelus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-14T12:01:05.000Z","updated_at":"2024-06-11T22:54:57.524Z","dependencies_parsed_at":"2024-06-11T23:09:08.661Z","dependency_job_id":null,"html_url":"https://github.com/anhgelus/les-copaings-bot","commit_stats":null,"previous_names":["anhgelus/les-copaings-bot"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fles-copaings-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fles-copaings-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fles-copaings-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fles-copaings-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anhgelus","download_url":"https://codeload.github.com/anhgelus/les-copaings-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514533,"owners_count":21116977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","discord","discord-bot","discordgo","go","golang"],"created_at":"2024-11-25T13:44:02.367Z","updated_at":"2025-04-12T04:22:19.192Z","avatar_url":"https://github.com/anhgelus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Les Copaings Bot\n\nBot for the private server Discord \"Les Copaings\"\n\n## Features\n\n- Levels \u0026 XP\n- Roles management\n- Purge command\n\n### XP\n\nFunctions:\n- $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 \nmessage (number of different rune)\n- $xp-vocal(x)=0.01 x^{1.3}+1$ where $x$ is the time spent in vocal (in second)\n- $level(x)=0.2 \\sqrt{x}$ where $x$ is the xp\n- $level^{-1}(x)=(5x)^2$ where $x$ is the level\n- $lose(x,y)= x^2\\cdot 10^{-2+\\ln(x/85)}\\cdot\\lfloor y/500 +1 \\rfloor$ where $x$ is the inactivity time (hour) and $y$ is the xp\n\n## Installation\n\nThere are two ways to install the bot: docker and build.\n\n### Docker\n\n1. Clone the repository\n```bash\n$ git clone https://github.com/anhgelus/les-copaings-bot.git\n```\n2. Go into the repository, rename `.env.example` into `.env` and customize it: add your token, change the user and the \npassword of the database\n3. Start the compose file\n```bash\n$ docker compose up -d --build\n```\n\nNow you have to edit `config/config.toml`.\nYou can understand how this config file works below.\nAfter editing this file, you have to start again the bot.\nEvery time you edit this file, you must restart the bot.\n\nYou can stop the compose file with `docker compose down`\n\n### Build\n\n1. Clone the repository\n```bash\n$ git clone https://github.com/anhgelus/les-copaings-bot.git\n```\n2. Install Go 1.22+\n3. Go into the repository and build the program\n```bash\n$ go build . \n```\n4. Run the application through bash (or PowerShell if you are on Windows)\n\nNow you have to edit `config/config.toml`.\nYou can understand how this config file works below.\nAfter editing this file, you have to start again the bot.\nEvery time you edit this file, you must restart the bot.\n\n## Config\n\nThe main config file is `config/config.toml`.\n\nThe default configuration is\n```toml\ndebug = false\nauthor = \"anhgelus\"\n\n[redis]\naddress = \"localhost:6379\"\npassword = \"\"\ndb = 0\n\n[database]\nhost = \"localhost\"\nuser = \"\"\npassword = \"\"\ndb_name = \"\"\nport = 5432\n```\n\n- `debug` is true if the bot is in debug mode (don't turn it on unless you are modifying the source code)\n- `author` is the author's name\n- `[redis].address` is the address of redis (using docker, it's `redis:6379`)\n- `[redis].password` is the redis's password\n- `[redis].db` is the db to use\n- `[database].host` is the host of postgres (using docker, it's `postgres`)\n- `[database].user` is the user of postgres to use (using docker, it must be the same value as `POSTGRES_USER` in `.env`)\n- `[database].password` is the user's password of postgres to use (using docker, it must be the same value as\n`POSTGRES_PASSWORD` in `.env`)` \n- `[database].db_name` is the postgres's database name to use (using docker, it must be the same value as `POSTGRES_DB`\nin `.env`)\n- `[database].port` is the port of postgres to use (using docker, it's `5432`)\n\n## Technologies\n\n- Go 1.22\n- anhgelus/gokord\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanhgelus%2Fles-copaings-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanhgelus%2Fles-copaings-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanhgelus%2Fles-copaings-bot/lists"}