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