From 211888b8a396df8d5166afba85af54e0240015c1 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 13 Aug 2023 11:54:33 +0530 Subject: removed MAL2Go documentation --- content/docs/mal2go/v4/anime/get-anime-by-id.md | 42 ------------------------- 1 file changed, 42 deletions(-) delete mode 100644 content/docs/mal2go/v4/anime/get-anime-by-id.md (limited to 'content/docs/mal2go/v4/anime/get-anime-by-id.md') diff --git a/content/docs/mal2go/v4/anime/get-anime-by-id.md b/content/docs/mal2go/v4/anime/get-anime-by-id.md deleted file mode 100644 index ca310b3..0000000 --- a/content/docs/mal2go/v4/anime/get-anime-by-id.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: "Getting an anime's information" -description: "Specify an anime's ID to get all the data about it." -weight: 3 ---- - -`GetAnimeById` takes in an anime's ID (which can be obtained using [`SearchAnime`](/docs/mal2go/v4/anime/search-for-an-anime) or through the URL of the anime's page on MAL) and returns information about it. This method takes these arguments: - -- `id int` The anime's ID -- `fields []string` The fields to include in the response. [Here](/docs/mal2go/v4/anime/types#mal2goanimeanime) is a list of the valid fields. Just using an empty slice (`[]string{}`) will include all the fields. - -Example: - -``` go -package main - -import ( - "github.com/MikunoNaka/MAL2Go/v4/anime" - "log" - "fmt" -) - -func main() { - authToken := "YOUR_TOKEN_HERE" - myClient := anime.Client { - AuthToken: "Bearer " + authToken, - } - - id := 457 - fields := []string{"title", "my_list_status", "num_episodes"} - - anime, err := myClient.GetAnimeById(id, fields) - if err != nil { - log.Fatal(err) // remember kids, always handle errors - } - - fmt.Printf("You have watched %d out of %d episodes in %s. Your list status for %s is %s.\n", anime.MyListStatus.EpWatched, anime.NumEpisodes, anime.Title, anime.Title, anime.MyListStatus.Status) -} -``` - -Above example prints something like -`"You have watched 26 out of 26 episodes in Mushishi. Your list status for Mushishi is completed."` -- cgit v1.2.3