Browse Source

Removed feature to convert user to bot account.

This feature was removed by Discord and no longer works.
Bruce Marriner 8 năm trước cách đây
mục cha
commit
777a81710d
2 tập tin đã thay đổi với 2 bổ sung39 xóa
  1. 2 9
      oauth2.go
  2. 0 30
      oauth2_test.go

+ 2 - 9
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
 	}

+ 0 - 30
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
-}