We provide a basic config file, it is located at config.example.ini. Please rename it to config.ini
Note that python packages for this are 'pinned' in requirements.txt
pip3 install -r ./requirements.txt
virtualenv --python=/usr/bin/python3 venv
source venv/bin/activate
pip3 install -r ./requirements.txt
If you decide to do this in Docker, local installation is not necessary.
./run.sh SomeLocalContainerName
will start a local python:3 container, mount the repo into /usr/src/legobot, install deps, and then run the chatbot.py script.
If you don't use virtualenv you can directly start the bot:
python3 chatbot.py
In case of virtualenv you first have to activate it:
source venv/bin/activate
python3 chatbot.py
We can create a systemd service file in the namespace of our linux user, which doesn't require any root priviledges. This allows us to easily utilize systemd features. Create the directory:
mkdir -p ~/.config/systemd/user
After that, create a thevoxfox.service file in it with the following content (it assumes that you cloned this repository into your home directory, please replace $USER with your actual username):
[Unit]
Description=TheVoxFox IRC Bot
After=network.target
[Service]
WorkingDirectory=/home/$USER/thevoxfox
ExecStart=/home/$USER/thevoxfox/venv/bin/python3 /home/$USER/thevoxfox/chatbot.py
PrivateTmp=true
[Install]
WantedBy=default.target
You can now start/stop/restart/status the bot with:
systemctl --user start thevoxfox
systemctl --user status thevoxfox
systemctl --user restart thevoxfox
systemctl --user restart thevoxfox
If you want the service to start at boot and run when logged out:
sudo loginctl enable-linger $USER
You can run it persistently with:
systemctl --user enable thevoxfox
Use the config.ini to provide settings to the chatbot.py script
See this link