mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
c071e4d644
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
27 lines
411 B
GDScript
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
|
|
|
|
|