The easiest way to get started is to use a docker-compose file, which includes all the needed services:
version: "3"
services:
db:
image: supinic/supidb
restart: unless-stopped
volumes:
- <path_to_store_db>:/var/lib/mysql
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=1
- MYSQL_PASSWORD=supibot
- MYSQL_USER=supibot
redis:
image: redis
restart: unless-stopped
supibot:
links:
- db
- redis
image: supinic/supibot
restart: unless-stopped
environment:
- "MARIA_HOST=db"
- "MARIA_USER=supibot"
- "MARIA_PASSWORD=supibot"
- "REDIS_CONFIGURATION=redis"
- "COMMAND_PREFIX=<command_prefix>"
- "INITIAL_BOT_NAME=<bot_name>"
- "INITIAL_PLATFORM=twitch"
#- "INITIAL_PLATFORM=discord"
- "INITIAL_CHANNEL=<initial_channel>"
- "TWITCH_CLIENT_ID=<your_client_id>"
#- "DISCORD_BOT_TOKEN=<discord_token>"
- "TWITCH_OAUTH=<your_oauth>"
- "SUPIBOT_API_PORT=<preferred_api_port>"
Customize values such as INITIAL_CHANNEL
, COMMAND_PREFIX
and the authentication info as needed.
You can use this tool or this one to fetch your OAuth keys for Twitch.
- Note 1: The database docker image currently doesn't accept any usernames other than
supibot
. - Note 2: Make sure to include the
user:manage:whispers
scope in your OAuth token if you would like the standard Twitch whisper functionality to work.
Setting Supibot up locally requires several steps, and is much easier if done with an interactive script.
- Set up
MariaDB
of at least version10.2.0
and credentials. Ideally, create a user separate for Supibot that has permissions ondata
andchat_data
databases. - Set up
Redis
git clone
orfork
the repository- Run
npm/yarn install
, depending on which package manager you use - Run
npm/yarn run setup
and walk through the interactive setup script, making sure to set up at least one platform, one channel and the command prefix - Run
npm/yarn start
, ornpm run debug / yarn debug
for debug access
Alternatively, if run setup
does not work or for whatever other reason, follow this manual setup:
- Set up
MariaDB
of at least version10.2.0
+ credentials - Set up
Redis
git clone
orfork
the repository- Copy
db-access.js.example
asdb-access.js
(do not commit this file) - Fill in your
MariaDB
credentials todb-access.js
, using sockets or hosts respectively - Run
npm/yarn install
- Run
npm/yarn run init-database
- Run
npm/yarn start
to verify that the bot can start up correctly. If it does, it will not attempt to join any platforms or channels. In order to do so, continue: - Fill in authentication token(s) in
data.Config
, depending on which platform to join - by editing itsValue
fromNULL
to given token - For each platform to join, edit its
chat_data.Platform
row and set up Supibot's account nameSelf_Name
- Set up at least one channel per platform to
chat_data.Channel
table, by inserting a new row, and filling the channel'sName
andPlatform
- Edit
COMMAND_PREFIX
indata.Config
for your preferred command prefix - Run the bot as in 7), or
npm/yarn run debug
for debug access
In order to set yourself as the administrator
of Supibot:
- Make sure you have been seen by the bot - check the
chat_data.User_Alias
table, find your name, and note the user ID - Create a new row in the
chat_data.User_Alias_Data
table:
User_Alias
is the ID you notedProperty
isadministrator
Value
istrue
- Changes should apply immediately, in case they don't, restart the bot