From 302f4976a93f7c90b572f25e20e3fc87f6dc7088 Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Tue, 3 Nov 2015 08:51:21 -0600 Subject: [PATCH] Renamed RequestToken to Login --- client.go | 2 +- discord.go | 2 +- session.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client.go b/client.go index 6864bc6..4324c0e 100644 --- a/client.go +++ b/client.go @@ -20,7 +20,7 @@ import ( ) // RequestToken asks the Discord server for an authentication token -func RequestToken(session *Session, email string, password string) (token string, err error) { +func Login(session *Session, email string, password string) (token string, err error) { var urlStr string = fmt.Sprintf("%s/%s", discordApi, "auth/login") req, err := http.NewRequest("POST", urlStr, bytes.NewBuffer([]byte(fmt.Sprintf(`{"email":"%s", "password":"%s"}`, email, password)))) diff --git a/discord.go b/discord.go index c149501..660827d 100644 --- a/discord.go +++ b/discord.go @@ -34,7 +34,7 @@ func New(email string, password string) (d *Discord, err error) { session := Session{} - session.Token, err = session.RequestToken(email, password) + session.Token, err = session.Login(email, password) if err != nil { return } diff --git a/session.go b/session.go index 9bbe983..cb6ea40 100644 --- a/session.go +++ b/session.go @@ -17,8 +17,8 @@ type Session struct { * The below functions are "shortcut" methods for functions in client.go * Reference the client.go file for more documentation. */ -func (session *Session) RequestToken(email string, password string) (token string, err error) { - token, err = RequestToken(session, email, password) +func (session *Session) Login(email string, password string) (token string, err error) { + token, err = Login(session, email, password) return }