ref #106 on online-bot example

This commit is contained in:
Tnze
2022-05-27 17:38:56 +08:00
parent 61f9625297
commit 7bb5c2db87
2 changed files with 7 additions and 3 deletions

View File

@ -48,12 +48,16 @@ func ExampleClient_JoinServer_offline() {
func ExampleClient_JoinServer_online() {
c := NewClient()
//Login Mojang account to get AccessToken
// Login Mojang account to get AccessToken
// To use Microsoft Account, see issue #106
// https://github.com/Tnze/go-mc/issues/106
auth, err := yggdrasil.Authenticate("Your E-mail", "Your Password")
if err != nil {
panic(err)
}
// As long as you set these three fields correctly,
// the client can connect to the online-mode server
c.Auth.UUID, c.Auth.Name = auth.SelectedProfile()
c.Auth.AsTk = auth.AccessToken()