From 777a81710dd0078db9bcf60b619549aa3b821a2e Mon Sep 17 00:00:00 2001 From: Bruce Marriner Date: Tue, 14 Jun 2016 09:04:00 -0500 Subject: [PATCH] Removed feature to convert user to bot account. This feature was removed by Discord and no longer works. --- oauth2.go | 11 ++--------- oauth2_test.go | 30 ------------------------------ 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/oauth2.go b/oauth2.go index d1b9a49..de2848d 100644 --- a/oauth2.go +++ b/oauth2.go @@ -106,18 +106,11 @@ func (s *Session) ApplicationDelete(appID string) (err error) { // ApplicationBotCreate creates an Application Bot Account // // appID : The ID of an Application -// token : The authentication Token for a user account to convert into -// a bot account. This is optional, if omited a new account -// is created using the name of the application. // // NOTE: func name may change, if I can think up something better. -func (s *Session) ApplicationBotCreate(appID, token string) (st *User, err error) { +func (s *Session) ApplicationBotCreate(appID string) (st *User, err error) { - data := struct { - Token string `json:"token,omitempty"` - }{token} - - body, err := s.Request("POST", EndpointApplicationsBot(appID), data) + body, err := s.Request("POST", EndpointApplicationsBot(appID), nil) if err != nil { return } diff --git a/oauth2_test.go b/oauth2_test.go index 96ad736..168d33b 100644 --- a/oauth2_test.go +++ b/oauth2_test.go @@ -55,33 +55,3 @@ func ExampleApplication() { return } - -// This provides an example on converting an existing normal user account -// into a bot account. You must authentication to Discord using your personal -// username and password then provide the authentication token of the account -// you want converted. -func ExampleApplicationConvertBot() { - - dg, err := discordgo.New("myemail", "mypassword") - if err != nil { - log.Println(err) - return - } - - // create an application - ap := &discordgo.Application{} - ap.Name = "Application Name" - ap.Description = "Application Description" - ap, err = dg.ApplicationCreate(ap) - log.Printf("ApplicationCreate: err: %+v, app: %+v\n", err, ap) - - // create a bot account - bot, err := dg.ApplicationBotCreate(ap.ID, "existing bot user account token") - log.Printf("BotCreate: err: %+v, bot: %+v\n", err, bot) - - if err != nil { - log.Printf("You can not login with your converted bot user using the below token\n%s\n", bot.Token) - } - - return -}