- C 98%
- Makefile 1.5%
- Dockerfile 0.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
Create doc, publish it to wiki and send webhook / documentation (push) Successful in 26s
|
||
| .forgejo | ||
| src | ||
| .gitignore | ||
| Dockerfile | ||
| makefile | ||
| README.md | ||
c-tickets
C-tickets bot
Installation
From source
Get the code : git clone https://git.greensky.tf/Greensky/discord-announcements-publisher.git && cd discord-announcements-publisher
Prerequisiteries
You need to have the Concord library, since it is written in C and is required
Here are the steps to install it :
git clone https://git.greensky.tf/Miroir/concord.git && cd concord(or from the original source (mine is a mirror, it is the same ) :git clone https://github.com/cogmasters/concord && cd concord)makesudo make install
If you need to remove concord, run :
sudo rm -rf /usr/local/include/concord /usr/local/lib/libdiscord.a
Setup
Then you need to setup a config.json file. Here is an example :
{
"logging": {
"level": "trace",
"filename": "bot.log",
"quiet": false,
"overwrite": true,
"use_color": true,
"http": {
"enable": true,
"filename": "http.log"
},
"disable_modules": ["WEBSOCKETS", "USER_AGENT"]
},
"discord": {
"token": "YOUR-BOT-TOKEN",
"default_prefix": {
"enable": false,
"prefix": "YOUR-COMMANDS-PREFIX"
}
}
}
Example from https://git.greensky.tf/Miroir/concord/src/commit/fb0f834d07d65048a6afde177e318fe9659a9494/config.json (I took it from my mirror because forgejo exposes a "Permalink" button to get a permanent url to the said file)
Put it in the same folder as the repository
Environment
You need a .env file, containing the following values :
DATABASE_HOST=ip-of-host
DATABASE_USER=user-of-database
DATABASE_PASSWORD=password-of-user
DATABASE_NAME=name-of-database
GUILD_ID=id-of-your-server
STAFF_ROLE_ID=id-of-role-that-access-tickets
Compiling
You can compile the code by running : make cleanbuild
Launching
Launch it by running ./bin/main.uwu (the default file).
Container
You still need a
config.jsonfile, and.envfile
You can make the use of a docker-compose.yaml file, such as :
services:
watchbot:
image: git.greensky.tf/greensky/c-tickets:latest
container_name: c-ticketes
restart: always
volumes:
- /absolute/path/to/config.json-file:/var/discord/c-tickets/config.json
- /absolute/path/to/.env-file:/var/discord/c-tickets/.env
Then start it up : docker compose up -d and you're set