diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-13 11:54:33 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-08-13 11:54:33 +0530 |
commit | 211888b8a396df8d5166afba85af54e0240015c1 (patch) | |
tree | 14edbc114f5cec9da57dd08c9369e3c2f1aaa80c /content/docs/mal2go/v4/user/get-self-user-info | |
parent | 54e1b7496d6a06c92b030114e9d54019ab4ba87f (diff) |
removed MAL2Go documentation
Diffstat (limited to 'content/docs/mal2go/v4/user/get-self-user-info')
-rw-r--r-- | content/docs/mal2go/v4/user/get-self-user-info/_index.md | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/content/docs/mal2go/v4/user/get-self-user-info/_index.md b/content/docs/mal2go/v4/user/get-self-user-info/_index.md deleted file mode 100644 index 31b943c..0000000 --- a/content/docs/mal2go/v4/user/get-self-user-info/_index.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: Getting authenticated user's info -description: Returns information about currenlty logged in user -weight: 2 ---- - -## Getting self user's info - -The `GetSelfUserInfo` function can be used to get information about the currently logged in user. - -``` go -package main - -import ( - "fmt" - "log" - "github.com/MikunoNaka/MAL2Go/v4/user" -) - -func main() { - authToken := "YOUR_TOKEN_HERE" - myClient := user.Client { - AuthToken: "Bearer " + authToken, - } - - userInfo, err := myClient.GetSelfUserInfo() - if err != nil { - log.Fatal(err) - } - - fmt.Printf("Username: %s\n", userInfo.Name) - fmt.Printf("Profile Picture: %s\n", userInfo.Picture) - fmt.Printf("Gender: %s\n", userInfo.Gender) - fmt.Printf("Location: %s\n", userInfo.Location) - fmt.Printf("Birthday: %s\n", userInfo.Birthday) - fmt.Printf("Time Zone: %s\n", userInfo.TimeZone) - fmt.Printf("Joined At: %s\n", userInfo.JoinedAt) - fmt.Printf("User ID: %d\n", userInfo.Id) - - if userInfo.IsSupporter { - fmt.Println("You are a MyAnimeList Supporter.") - } else { - fmt.Println("You are not a MyAnimeList Supporter.") - } -} -``` - -**MyAnimeList's Official API only allows getting info about the currently logged in user.** |