miggor-StreamGraph/addons/no_twitch/demo/demo_scene.gd
Eroax c071e4d644 TWITCH INTEGRATION (#13)
Implemented a basic Twitch Connection, + Twitch Receive Chat and Twitch Send Chat

Co-authored-by: Eroax <eroaxe.business@gmail.com>
Reviewed-on: https://codeberg.org/Eroax/StreamGraph/pulls/13
2023-12-08 09:53:06 +00:00

27 lines
411 B
GDScript

extends Control
func _ready():
$Twitch_Connection.token_received.connect(save_token)
load_token()
func save_token(token):
var res = TokenSaver.new()
res.token = token
ResourceSaver.save(res, "user://token.tres")
func load_token():
if !FileAccess.file_exists("user://token.tres"):
return
var res = ResourceLoader.load("user://token.tres")
$Twitch_Connection.token = res.token