|
@@ -55,33 +55,3 @@ func ExampleApplication() {
|
|
|
|
|
|
return
|
|
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
|
|
|
|
-}
|
|
|