Tom/README.md

55 lines
1.8 KiB
Markdown
Raw Normal View History

2021-07-27 01:52:22 +02:00
# Simple Bot Twitch en Python utilisant la librairie [TwitchIO](https://github.com/TwitchIO/TwitchIO).
2021-07-27 03:19:59 +02:00
## Setup and Run
2021-07-29 00:56:22 +02:00
### Locally
2021-07-27 03:19:59 +02:00
Requires Python `3.9.5`.
Install necessary packages:
2021-08-20 08:39:28 +02:00
```batch
2021-07-27 03:19:59 +02:00
python3 -m pip install -r requirements.txt
```
Rename `.envexample` file in `.env` in root folder, then open the file and complete the fields, there is an explanation below:
2021-07-27 03:19:59 +02:00
2021-07-27 21:56:02 +02:00
| Field | Explanation |
2021-07-29 00:56:22 +02:00
|----------------|-------------|
2021-07-27 21:56:02 +02:00
| `ACCESS_TOKEN` | Access token of the account you created for your bot that you can take [here](https://twitchtokengenerator.com/) (be sure you selected Bot Chat Token) |
| `PREFIX` | Prefix you want to use for your bot |
| `CHANNEL` | The name of the your Twitch channel you want the bot to run at (separate by comma) |
2021-07-27 03:19:59 +02:00
Start Bot:
2021-08-20 08:39:28 +02:00
```batch
2021-07-27 03:19:59 +02:00
cd src
python3 main.py
```
2021-07-27 23:39:49 +02:00
2021-07-29 00:56:22 +02:00
### With Docker
2021-07-27 23:39:49 +02:00
2021-07-28 22:46:55 +02:00
With a [docker-compose](https://gitlab.com/ConfrerieDuKassoulait/Bot-Tom/-/blob/main/docker-compose.yml) or in command line:
2021-07-27 23:39:49 +02:00
2021-08-20 08:39:28 +02:00
```batch
2021-07-27 23:39:49 +02:00
docker run -d \
--name="TwitchBot" \
2021-07-28 22:46:55 +02:00
registry.gitlab.com/confreriedukassoulait/bot-tom:latest \
2021-07-27 23:39:49 +02:00
--ACCESS_TOKEN="yourAccessToken" \
--PREFIX="yourPrefix" \
--CHANNEL="yourChannel(s)" \
-v /here/your/path/:/db
2021-07-27 23:39:49 +02:00
```
2021-07-29 00:56:22 +02:00
## Features
Here the list of available commands by default:
2021-08-20 08:36:03 +02:00
| Command | Alias | Explanation |
|-----------|-----------------------|-------------|
| `add` | | Ajoute une commande de la base de donnée du bot : `add` `omDeLaCommande` `messageDeLaCommande` |
| `remove` | `delete` | Supprime une commande de la base de donnée du bot : `remove` `nomDeLaCommande` |
| `list` | `commande.s` / `help` | Affiche la liste des commandes (base de donnée + intégré au bot) |
| `edit` | | Modifie une commande de la base de donnée du bot : `add` `nomDeLaCommande` `nouveauMessageDeLaCommande` |