Tom/README.md

56 lines
1.7 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:
```bash
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:
```bash
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
```bash
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)" \
--DISCORD="yourDiscordLink" \
-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:
| Command | Explanation |
|-----------|-------------|
| `add` | Ajoute une commande de la base de donnée du bot : `add` `omDeLaCommande` `messageDeLaCommande` |
| `remove` | Supprime une commande de la base de donnée du bot : `remove` `nomDeLaCommande` |
2021-07-29 02:46:08 +02:00
| `list` | Affiche la liste des commandes (base de donnée + intégré au bot) |
2021-07-29 00:56:22 +02:00
| `edit` | Modifie une commande de la base de donnée du bot : `add` `nomDeLaCommande` `nouveauMessageDeLaCommande` |