PhantomBot

PhantomBot is an actively developed open source interactive Twitch bot written in Java that provides entertainment and moderation for your channel.


Note

For this guide you should be familiar with the basic concepts of

License

PhantomBot is licensed under the GNU General Public License v3 (GPL-3).

Prerequisites

Setup your URL for the bot panel:

[isabell@stardust ~]$ uberspace web domain list
isabell.uber.space
[isabell@stardust ~]$

Installation

Download the latest release from GitHub. Make sure to replace X.X.X with the latest version!

[isabell@stardust ~]$ wget https://github.com/PhantomBot/PhantomBot/releases/download/vX.X.X/PhantomBot-X.X.X.zip
[isabell@stardust ~]$

Then unzip the release folder, rename it and switch into it:

[isabell@stardust ~]$ unzip PhantomBot-X.X.X.zip && mv PhantomBot-X.X.X phantombot && cd phantombot
[...]
[isabell@stardust phantombot]$

The last thing we need to do is to assign the right privileges to make the launch.sh, launch-service.sh & java runtime files executable.

[isabell@stardust phantombot]$ chmod u+x launch-service.sh launch.sh ./java-runtime-linux/bin/java
[isabell@stardust phantombot]$

Configuration

PhantomBot Setup

To setup PhantomBot for the first time, run launch.sh.

[isabell@stardust phantombot]$ ./launch.sh
[...]

PhantomBot will guide you through its configuration. After the configuration is done, close PhantomBot by pressing CTRL-C and continue with the next step.

Configure web server

PhantomBot binds to localhost in the default configuration. This prevents the Panel from being used with a web backend. To bind the bot to 0.0.0.0, add bindIP=0.0.0.0 to botlogin.txt in the config folder.

[isabell@stardust phantombot]$ echo "bindIP=0.0.0.0" >> ~/phantombot/config/botlogin.txt
[isabell@stardust phantombot]$

Note

PhantomBot is running on port 25000 in the default configuration.

To make the application accessible from the outside, configure a web backend:

[isabell@stardust ~]$ uberspace web backend set / --http --port <port>
Set backend for / to port <port>; please make sure something is listening!
You can always check the status of your backend using "uberspace web backend list".
[isabell@stardust ~]$

Setup daemon

Create ~/etc/services.d/phantombot.ini with the following content:

[program:phantombot]
command=%(ENV_HOME)s/phantombot/launch.sh
autorestart=true
autostart=true
startsecs=30

After creating the configuration, tell supervisord to refresh its configuration and start the service:

[isabell@stardust ~]$ supervisorctl reread
SERVICE: available
[isabell@stardust ~]$ supervisorctl update
SERVICE: added process group
[isabell@stardust ~]$ supervisorctl status
SERVICE                            RUNNING   pid 26020, uptime 0:03:14
[isabell@stardust ~]$

If it’s not in state RUNNING, check your configuration.

Updates

Stop your PhantomBot:

[isabell@stardust ~]$ supervisorctl stop phantombot
[isabell@stardust ~]$

Then rename the old folder:

[isabell@stardust ~]$ mv phantombot phantombot-old
[isabell@stardust ~]$

Note

If you receive an error that the phantombot-old directory already contains a file, then either remove the phantombot-old directory or rename it.

Get the latest PhantomBot release from GitHub:

[isabell@stardust ~]$ wget https://github.com/PhantomBot/PhantomBot/releases/download/vX.X.X/PhantomBot-X.X.X.zip
[isabell@stardust ~]$

Then unzip the release folder and rename it to make future updates a bit easier - but do not switch into it yet:

[isabell@stardust ~]$ unzip PhantomBot-X.X.X.zip && mv PhantomBot-X.X.X phantombot
[...]
[isabell@stardust ~]$

Copy your config folder to your new folder:

[isabell@stardust ~]$ cp -R ./phantombot-old/config/ ./phantombot/
[...]
[isabell@stardust ~]$ cp -R ./phantombot-old/scripts/lang/custom/ ./phantombot/scripts/lang/

The last thing we need to do is to assign the right privileges to make the launch.sh, launch-service.sh & java runtime files executable.

[isabell@stardust ~]$ cd phantombot
[isabell@stardust phantombot]$ chmod u+x launch-service.sh launch.sh ./java-runtime-linux/bin/java

Now we are ready to launch PhantomBot again. You can run the bot with:

[isabell@stardust phantombot]$ supervisorctl start phantombot
[isabell@stardust phantombot]$

Tested with PhantomBot 3.1.2 on Uberspace 7.6.2.

Written by: tobimori <tobias@moeritz.cc>