Installation Guide - maidnaut/clang GitHub Wiki

Installation Guide




Package building Clang

  1. Git clone the pkgbuild version (made by Jorgen) https://github.com/Jorgen10/clang-pkgbuild.git
  2. cd into Clang's directory: cd clang-pkgbuild
  3. Run makepkg: makepkg -si
  4. Modify the .env file with BOT_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
  5. 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 folder DATA_DIR points to, then rerun it.

OR:

Manual install

  1. Create a venv in Clang's directory: python3 -m venv ~/path_to_clang/.venv
  2. Set the venv source: source ~/path_to_clang/.venv/bin/activate
  3. Install py-cord and Clang's dependencies: pip install py-cord rich alt-profanity-check audioop-lts
  4. 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"



Post-install

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

  1. Go to discord's developer portal and create a new bot for your instance of Clang.
  2. Generate a new token in the bot tab. Hold onto it because we're going to need it in a second.
  3. Generate a new invite link for Clang in the OAuth tab, selecting bot in the scopes.
  4. 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.

⚠️ **GitHub.com Fallback** ⚠️