Installation Guide - maidnaut/clang GitHub Wiki
- Git clone the pkgbuild version (made by Jorgen)
https://github.com/Jorgen10/clang-pkgbuild.git
- cd into Clang's directory:
cd clang-pkgbuild
- Run makepkg:
makepkg -si
- Modify the
.env
file withBOT_TOKEN=<token>
(where<token>
is your bot token). The file is located in one of the following places depending on how you plan to run Clang:- Systemd service:
/var/lib/python-clang/.env
- Manually:
- If
$XDG_DATA_HOME
is set,$XDG_DATA_HOME/python-clang/.env
- Otherwise
~/.local/share/python-clang/.env
- If you are unhappy with said locations, make a folder and running clang with
DATA_DIR=<path> python-clang
- If
- Systemd service:
- Run Clang:
- To run it as a systemd service, use
sudo systemctl enable --now python-clang
- Alternatively, you can manually run Clang with a couple of options:
- Running
python-clang
(look at the config location above for configuring the.env
file) - Running
DATA_DIR=<path> python-clang
. This allows you to store the data files wherever you want.- The first run will likely crash. Add your bot token to the
.env
file located in the folderDATA_DIR
points to, then rerun it.
- The first run will likely crash. Add your bot token to the
- Running
- To run it as a systemd service, use
OR:
- Create a venv in Clang's directory:
python3 -m venv ~/path_to_clang/.venv
- Set the venv source:
source ~/path_to_clang/.venv/bin/activate
- Install py-cord and Clang's dependencies:
pip install py-cord rich alt-profanity-check audioop-lts
- cd into Clang's directory and run it:
python3 clang.py
If you want, you can alias Clang to something in .bashrc
so you don't have to initialize the venv manually every time,
alias clang="cd ~/clang && source .venv/bin/activate && python clang.py"
Once you have Clang set up on your host machine/server, there's a few things you need to do to get it up and running.
Phase 1
- Go to discord's developer portal and create a new bot for your instance of Clang.
- Generate a new token in the bot tab. Hold onto it because we're going to need it in a second.
- Generate a new invite link for Clang in the OAuth tab, selecting
bot
in the scopes. - If you're running Clang yourself, it'll ask you to paste the token into the terminal. If you installed it with the makepkg option, skip this step because you should have already made the .env file for the token yourself.
Phase 2
After you've got Clang connected to your server, you need to create the required roles and channels for its moderation suite to run correctly. By default Clang should accept (most) commands from the server owner, but to use the mod suite you need to create the following roles and channels. If you'd like to skip !op roles, just run !elevation off
, and if you want do disable the submod role, you can just choose to not set it.
All channels and roles MUST be supplied by their id.
Roles (run with !setrole <name> <id>
):
- jailed
- submod
- mod
- op
- admin
- root
Channels (run with !setchannel <name> <id>
):
- joinlog
- modlog
- logs
- ticketlog
- jaillog
- mod_channel
Categories (run with !setchannel <name> <id>
):
- ticket_category
- jail_category
- mod_category
After that, Clang should be good to go! Run !help
in a channel to verify Clang is working.