From 85aadb514b20f88055b693bdf01bfe04280586f7 Mon Sep 17 00:00:00 2001 From: itzaname Date: Thu, 17 Jan 2019 23:19:18 -0500 Subject: [PATCH] Get username from roblox API rather than manually passing it --- session.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/session.go b/session.go index c24ed37..2106614 100644 --- a/session.go +++ b/session.go @@ -15,7 +15,7 @@ type Session struct { } // New create a new session and logs in with provided data -func New(username, cookie string) (*Session, error) { +func New(cookie string) (*Session, error) { cookieJar, _ := cookiejar.New(nil) rbxCookie := []*http.Cookie{&http.Cookie{ Name: ".ROBLOSECURITY", @@ -28,7 +28,7 @@ func New(username, cookie string) (*Session, error) { Jar: cookieJar, } - session := Session{0, username, client} + session := Session{0, "", client} /*err := session.Login(username, password) if err != nil { @@ -41,6 +41,7 @@ func New(username, cookie string) (*Session, error) { } session.ID = info.UserID + session.Username = info.UserName return &session, err }