A super simple moderator bot that bans/timeouts people, if their first message contains a .ru link or the word bigfollows. Channels and users are saved to Postgres, which is included in the docker-compose.yaml. Using Knex.js and Objection.js for DB and tmi.js for Twitch chat.
npm install
tscor for docker
npm run docker:buildThis will create an image called dbot-twitchbot
npx knex migrate:latestRequired env variables:
BOT_TOKEN: Twitch bot token
POSTGRES_HOST: Postgres database host (defaults to localhost)
POSTGRES_PORT: Postgres database port (defaults to 5432)
POSTGRES_USER: Postgres database user
POSTGRES_PASSWORD: Postgres database password
POSTGRES_DB: Postgres database name
USE_MQ: true/false if RabbitMQ should be used to receive updates
Required if USE_MQ is true
MQ_PORT: RabbitMQ port
MQ_UI_PORT: RabbitMQ web UI port
MQ_URL: RabbitMQ connection url
docker-compose up -d
node dist/main.jstsc --watchkubectl create namespace twitchbot
kubectl apply -f k8s/twitchbot-configmap.yaml
kubectl create secret generic -n twitchbot twitchbot-secrets --from-literal=BOT_TOKEN=__TWITCH_BOT_TOKEN__ --from-literal=POSTGRES_PASSWORD=__POSTGRESQL_PASSWORD__
kubectl apply -f k8s/twitchbot.yaml