The easiest way to get started is to use a docker-compose file, which includes all the needed services.
To start off:
- Copy
config-default.jsonasconfig.json - In the config file, configure:
- Your desired platform(s)
- Anything regarding bot behaviour: commands, chat modules, logging, ...
- Copy
docker-compose.example.yamlasdocker-compose.yaml - In the compose file, set up:
- Bot environment values, and the authentication info as needed (see below for specific platforms)
- Absolute path to the freshly created
./config.jsonfile (<path_to_supibot_repository>) - Uncomment the
DEBUG_MODEenvironment value for debugging
- Run Docker:
docker compose up - For debugging:
- In your host machine's browser, navigate to
chrome://inspect - Add
localhost:9229 - Open the console via
Remote Target → inspect
- In your host machine's browser, navigate to
- Create an application: guide on Twitch
- Note your
Client IDandClient secrettokens - Visit this website for token generation, pick "Custom Scope Token"
- Fill in the section
Use My Client Secret and Client IDwith the tokens from step 2 - Allow token scopes:
user:botuser:read:chatuser:write:chatto read and send messages (required)user:read:emotesto fetch the bot's own emotes (suggested)user:manage:whispersfor whispers (private messages) functionality (suggested)channel:moderatefor moderation actions (optional)
- Generate the token, allow the Twitch authorization (make sure the account being authorized is your bot account!) and note the token
- Fill in the env values in the compose file accordingly:
TWITCH_CLIENT_IDTWITCH_CLIENT_SECRETTWITCH_REFRESH_TOKENINITIAL_TWITCH_CHANNEL
- Before running the bot, make sure to set it as the moderator in the channel set up by
INITIAL_TWITCH_CHANNEL, otherwise it won't be able to join.
- Create an application: Discord Developer Portal
- Navigate to
Application → Bot - Note the
Token(will only be available to copy once) andApplication ID - Set up the
Privileged Gateway Intents:Server membersandMessage content - Fill in the
Application IDinto yourconfig.json's discord platform, as theselfIdproperty - Fill in the env values in the compose file with your
Token:DISCORD_BOT_TOKEN
Setting Supibot up locally requires several steps, and is much easier if done with an interactive script.
- Set up
MariaDBof at least version10.2.0and credentials. Ideally, create a user separate for Supibot that has permissions ondataandchat_datadatabases. - Set up
Redis git cloneorforkthe repository- Run
yarn install, depending on which package manager you use - Run
yarn run setupand walk through the interactive setup script, making sure to set up at least one platform, one channel and the command prefix - Run
yarn start, oryarn debugfor debug access
Alternatively, if run setup does not work or for whatever other reason, follow this manual setup:
- Set up
MariaDBof at least version10.2.0+ credentials - Set up
Redis git cloneorforkthe repository- Copy
.example.envas.envand fill out all relevant env variables, including authentication credentials - Run
yarn install - Run
yarn run init-database - Run
yarn startto 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: - Copy
config-default.jsonasconfig.jsonand fill out your custom configuration, especially regarding desired platforms - Set up at least one channel per platform to
chat_data.Channeltable, by inserting a new row, and filling the channel'sName,Specific_IDandPlatform - Run the bot as in 7), or
yarn run debugfor 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_Aliastable, find your name, and note the user ID - Create a new row in the
chat_data.User_Alias_Datatable:
User_Aliasis the ID you notedPropertyisadministratorValueistrue
- Changes should apply immediately, in case they don't, restart the bot