饑荒聯機版

饑荒聯機版

39 次評價
Twitch Chat Integration (PyWitch)
   
獎勵
加入最愛
已加入最愛
移除最愛
檔案大小
發佈於
更新時間
840.072 KB
2021 年 11 月 14 日 下午 5:44
2021 年 11 月 14 日 下午 5:47
2 項更新註記 (檢視)

訂閱以下載
Twitch Chat Integration (PyWitch)

描述
THIS MOD REQUIRE EXTERNAL TOOLS TO WORK, FOLLOW THE INSTRUCTIONS CAREFULLY!




PyWtich: Twitch Chat Integration

This mod uses from a external tool called PyWitch Client to capture Twitch events, like chat messages, and show these events in-game.

For this version, only chat-messages are being integrated.

Everything is open source, so you can check PyWitch, PyWitch Client and PyWitch Auth in my Github! [github.com]

How to use

First, you need to download PyWitch Client from the RELASES page in my Github. You can do so by clicking this text[github.com]

[github.com]


I strongly recomend you to download it from source and run it using Python

After downloading and openning it, read the EULA. Since PyWitch Chat read from your Twitch Chat, your authorization will be required in the next step.
If you agree with the EULA, PyWitch Client will be ready to use.
Now you need to write your channel in the "channel box" (you can find your channel by acessing it on Twitch and reading the current URL).
Feel free to disable all features, leaving only PyWitch Chat enabled. The other features will be avaible in the following versions of this mod.

After that, click "Start PyWitch Server". Now a tab in your browser will be open, requesting authorization. This authorization is necessary to PyWitch Client be able to read your chat messages.

The authorization will redirect you to a tab with the name of all streamers that are using PyWitch Auth! Please consider visiting and supporting these Streamers channels!

For safety reasons, after you get your token from PyWitch Auth, it will be destroyed from the server, so if your token become invalid, a new one need to be generated.

Now, just wait for PyWitch Client to establish connection with Twitch server and its done! You can verify its working by acessing the following localhost URL:

127.0.0.1:13846/tmi [127.0.0.1]

If you see an empty json "{}", PyWitch Client started correctly
Now, send a message in your Twitch Chat and hit the refresh button in the PyWitch Client TMI URL.

If everything is working fine, you will see an json with your message and display name.

And its done!

In game, you just need to install the mod to your server and, in-game, open the PyWitch Menu by click its logo in the bottom left corner and hit the "Activate" button!

Now you will see the following Twitch Chat messages in your game!!

Upcoming features

As you can see from PyWitch and PyWitch Client, it already has some extra features. In the upcoming versions of this mod you will be able to capture Twitch Chat Redemptions in your server, making unique events and interactions to your game!

How it work

Don't Starve Together provides an internal function to perform REQUESTS on HTTP servers, which is very great to access data from server. However, Twitch Events, like chat messages and chat redemptions can only be accessed by WebSockets.
So, I developed a Python library to capture these events from Twitch. This library is called "PyWitch", and its source can be accessed by the following URL:

https://github.com/ouriquegustavo/pywitch

Ok, we are able to recover Twitch Events using a Python script... But we need to transfer that to Don't Starve Together.
To do so, I developed PyWitch Client, which is a GUI Interface combined with Web Framework (Flask). Its main purpose is to get events from Twitch using PyWitch and provide them on a localhost endpoint using Flask. Its source can be accessed by the following URL:

https://github.com/ouriquegustavo/pywitch_client

Now we can access Twitch Events from an HTTP server provided by PyWitch Client, the only remaining thing to solve is the token authentication.
Token authentication is made server side PyWitch Auth, which the source can be seen in the following URL:

https://github.com/ouriquegustavo/pywitch_auth

PyWitch Auth receives code from Twitch Authorization page and perform the required OAuth flow to generate the associated access token.
Any token is stored PyWith Auth server for more than 120 seconds. If you are not able to recover your token in this time, it will be destroyed. Every token generated in the server has an unique 128 characters state-code used for token request.
The server only will store public information about your Twitch user, like 'Display Name'. So I can recommend your live to other streamers :D

Special thanks!

I want to thanks HypeZ, 2000 and Butterflyholix for helping me testing this mod!

Enjoy!
13 則留言
Spider 2023 年 10 月 21 日 下午 5:06 
Could that be stated in the description? i uh, followed all the steps and...
Gleenus  [作者] 2022 年 11 月 24 日 下午 4:13 
Hi 󰀒lexon1󰀒

Not anymore, since the server-side authentication was made using Heroku, and now Heroku is not free anymore
󰀦lexon1󰀦 2022 年 11 月 14 日 下午 6:00 
Does the mod still work?
When i run client pywitch_client_one_file_0_7_0 and trying to authorisate with twitch i relaated to pywitch-auth.herokuapp.com and see this message: "There's nothing here, yet." And client still "waiting for authorization..." and nothing work
Dois D 2022 年 7 月 14 日 下午 8:53 
gleenus,vc faria um mod pra dizer quanto de fome o merm king está? pfvrzinhoooo amo seus mods
Gleenus  [作者] 2022 年 5 月 1 日 上午 6:48 
Hi @Zero, what kind of help? Can you be more clear?
Zero 2022 年 4 月 28 日 下午 6:11 
Hi Gleenus, would like some help on this mod if you could help me thanks.
Butterflyholix 2022 年 1 月 17 日 上午 4:58 
Mod maravilhoso , ajuda demais da conta ! toma meus pontos :steamthumbsup:
Sasamih 2021 年 12 月 19 日 上午 8:51 
Nossa, ficou muito bom, parabens!! :dstools::tabbycat:
big chillskis 2021 年 11 月 18 日 下午 4:43 
epic mod dude i love your stuff please come to brazil
Gleenus  [作者] 2021 年 11 月 18 日 上午 8:25 
Opa Axweel!
To considerando sim, só me falta tempo uahsuash
Mas vai rolar

E logo mais vou adicionar pra ter algumas redemptions do chat que nem tinha nas minhas lives