Bobotinho Bot
Main repository for the chatbot Bobotinho.
โน๏ธ
Introduction
Twitch chatbot with entertainment commands.
๐ป
Technologies
โ- Concurrent code with asyncio
- Asynchronous HTTP Client/Server with AIOHTTP
- Relational Database with PostgreSQL
- In-memory data structure store with Redis
- Asynchronous ORM (Object Relational Mapper) with Tortoise
- Asynchronous wrapper around the Twitch API with TwitchIO 2
๐
Services
- Application stability monitor with Bugsnag
- Chatbot Analytics with Dashbot
- Uptime monitoring service with UptimeRobot
- Coverage reports with Codecov
๐งฐ
Dev tools
โ- Code formatter with Black
- Style guide with flake8
- Run containers with Docker and Docker Compose
- Run GitHub Actions locally with act
- Pre-commit hooks with pre-commit
๐
Getting Started
It is assumed that you have:
- Twitch account for your bot.
- Python 3.8+ installed.
- Pip installed.
$ python3 --version
$ pip3 --version
๐
Access Token
Visit Token Generator and select the "Bot Chat Token". After selecting this you can copy your "Access Token" somewhere safe.
โ๏ธ
Configuring
After clone this repo, create .env
file in your /bobotinho-bot
directory. Add the access token from above and dev nick after the =
. Optionally add and fill other env vars (see .env.template
).
ACCESS_TOKEN=your-token-here
DEV_NICK=your-twitch-nick
โถ๏ธ
Run
๐
Option 1: locally
The standard library as of Python 3.3 comes with a concept called "Virtual Environment"s to keep libraries from polluting system installs or to help maintain a different version of libraries than the ones installed on the system.
Execute the following commands in your /bobotinho-bot
directory:
$ python3.8 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ env/bin/python bot.py
๐
Option 2: with docker
It is assumed that you have Docker installed.
$ docker --version
Otherwise, you can download and install Docker here.
Execute the following commands in your /bobotinho-bot
directory:
$ docker build -t bobotinho-bot .
$ docker run bobotinho-bot
๐ณ
Option 3: with docker-compose
It is assumed that you have Docker and Docker Compose installed.
$ docker --version
$ docker-compose --version
Otherwise, you can download and install Docker Compose here.
Execute the following commands in your /bobotinho-bot
directory:
$ docker-compose up --build
Use
--build
flag only on the first run
๐
Use
Go to twitch.tv/DEV_NICK
and send %ping
.