The program will use the .json files provided, and launch X docker containers, each based on a file.
In each container, a python program performs the following pseudo-code:
when CHANNEL_TO_MONITOR goes live:
for MESSAGE in MESSAGES_TO_SEND:
send MESSAGE on the chat of CHANNEL_TO_SEND_MESSAGE
sleep(COOLDOWN_BETWEEN_MESSAGES)
Open a terminal and type the following commands:
git clone https://github.com/titouanck/Twitch-messageOnLive.git
cd Twitch-messageOnLive
Inside the configurations/
directory, you will find multiple files ending with the extension .json
.
To get started, you can take a look at any of the .json file present in the directory.
![]() |
![]() |
Let's say we want to send « hello, world » on VICTOR's chat when NICOLAS goes live on Twitch.
Then, we could create a file some_name.json
inside the configurations/
directory and fill it like this:
{
"channel_to_monitor": "NICOLAS",
"channel_to_send_message": "VICTOR",
"messages_to_send": ["hello, world"],
"cooldown_between_messages": 0
}
Go back to your terminal and run the following command:
make
![Screenshot 2024-01-10 at 19 48 58](https://private-user-images.githubusercontent.com/87268044/295674481-b205b45f-4129-4d0f-a6e7-9daa18482bc8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwOTI1MzEsIm5iZiI6MTcyMDA5MjIzMSwicGF0aCI6Ii84NzI2ODA0NC8yOTU2NzQ0ODEtYjIwNWI0NWYtNDEyOS00ZDBmLWE2ZTctOWRhYTE4NDgyYmM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDExMjM1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE5NDRjMjk0MzY4OGUwOWU1Y2Q1ZGUyZTkzZmZkODllNDk0YjU1ODQwYjhkNmRhOWUxNWY3ZjM4ZTU3YmFhNTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.CO_U_Ly6QGngJ-sJC4u8W4goZ3OvadzwXnrTdJGzL0Y)
Follow the link to obtain an OAuth user token, which will only be visible to you and your browser.
![]() |
![]() |
Copy and paste the OAuth token into the terminal, and press enter.
![Screenshot 2024-01-10 at 20 11 31](https://private-user-images.githubusercontent.com/87268044/295680372-e8b4f485-fbbc-4f0a-82c7-fc1916569c6e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAwOTI1MzEsIm5iZiI6MTcyMDA5MjIzMSwicGF0aCI6Ii84NzI2ODA0NC8yOTU2ODAzNzItZThiNGY0ODUtZmJiYy00ZjBhLTgyYzctZmMxOTE2NTY5YzZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA0VDExMjM1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwMDFhMWMxMzJmODVlMzc3MjE3MDFlNmM0ZmJjZWE0NzQxNjk2N2Y1Nzg5YmM0OTllYzc4YzhlNGIyNTE2YzkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3uJ91-Pgwux9FUJ5yMKtlvttMI4pY6zZL6596pG1X7g)
If your token no longer works, you can simply delete the ./docker/.env file and type make
again.
You should now see something like that.
You don't ? It is possible that your docker installation requires you to be root to manipulate containers.
If so, use make sudo
instead of make
Creating docker/.env file...
alpine3.19: Pulling from library/python
Status: Image is up to date for python:alpine3.19
. . .
WARNING: The JSON_FILE_TRUNC variable is not set. Defaulting to a blank string.
WARNING: The JSON_FILE variable is not set. Defaulting to a blank string.
. . .
[✔️] docker-compose built successfully
Starting mol_kyzen_ ... done
Launching docker-compose up with kyzen_.json
Starting mol_podasai ... done
Launching docker-compose up with podasai.json
Starting mol_snayzy ... done
Launching docker-compose up with snayzy.json
Logs including live status and all chat messages are saved in the /logs
directory for as long as the program is running.
![]() |
![]() |
When kyzen_ launches his live stream, the first person to say « bonjour » is offered VIP status on his channel.
After several failed attempts to be the first to click on the stream start notification and say « bonjour », I thought it might be fun, and even a bit useful, to find a way of always being the first to say hi.