Automated payment for the Halogen game server.
- Python 3 (not python 2.x)
- pip (for dependencies)
- A Discord bot
- Make sure your Discord bot has the following permissions in your server and channel:
- Change Nickname
- View Channels
- Send Messages
- Embed Links
- Read Message History
- Mention Everyone
- Add Reactions
- Clone/Download the /script folder to your prefered location
- Install dependancies with pip
pip install -r requirements.txt
orpython -m pip install -r requirements.txt
- If running windows, use
win-requirements.txt
instead. - On some Linux/Mac systems, you may need to use
python3
andpip3
instead ofpython
andpip
, respectively.
- Configure the
cfg.json
file - Add the
bot.py
script as a systemd service to control it easily. The service file should look like the below, replacing thefilepaths
andusernames
:
# Put me in /etc/systemd/system/
[Unit]
Description=Halogen Pay Bot
After=multi-user.target
[Service]
User=<username>
WorkingDirectory=/home/<username>/halogen-pay/
ExecStart=/usr/bin/python3 /home/<username>/halogen-pay/scripts/bot.py
[Install]
WantedBy=multi-user.target
Change the behaviour of the program with the cfg.json
file.
First, configure the template.json
file and then rename it to cfg.json
when ready to use.
-
spreadsheet - value: name
- description: Name of the spreadsheet in gsheets.
-
worksheet - value: name
- description: Name of the worksheet inside the spreadsheet specified.
-
cred - value: file path
- description: Path to the Google API secrets file.
-
scope - value: list of urls
- description: A list of Google API URLs that should be used for gsheets.
-
role - value: number
- description: The identifying, numerical code for a role to mention on the Discord server in the alert message sent.
-
token - value: file path
- description: Path to the Discord bot token file.
-
url - value: url
- description: Valid API url to query Steam's datbase for the payee's SteamID.
-
key - value: file path
- description: Path to the Steam API key.
- Start and stop the bot by using the systemd service created previously in setup.
- Use cronjobs to schedule tasks with the
runner.py
file.