Skip to content

Sends a message to the chat room when the streamer goes live

Notifications You must be signed in to change notification settings

titouanck/Twitch-messageOnLive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What does it do ? How does it work ?

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)

1. Clone the project

Open a terminal and type the following commands:

git clone https://github.com/titouanck/Twitch-messageOnLive.git
cd Twitch-messageOnLive

2. Configure the project

2.1  Understand how it works

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.

Screenshot 2024-01-10 at 18 55 19 Screenshot 2024-01-10 at 19 26 43

2.2  Create your own .json file

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
}

3. Launch the project

Go back to your terminal and run the following command:

make
Screenshot 2024-01-10 at 19 48 58

Follow the link to obtain an OAuth user token, which will only be visible to you and your browser.

Screenshot 2024-01-10 at 20 01 47 Screenshot 2024-01-10 at 19 56 37

Copy and paste the OAuth token into the terminal, and press enter.

Screenshot 2024-01-10 at 20 11 31

If your token no longer works, you can simply delete the ./docker/.env file and type make again.


We did it!

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

Constant logs

Logs including live status and all chat messages are saved in the /logs directory for as long as the program is running.

Screenshot 2024-01-10 at 20 50 34 Screenshot 2024-01-10 at 20 41 03

 vip  A little background on this mini-project  vip 

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.

About

Sends a message to the chat room when the streamer goes live

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published