anilist

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorUint

func ColorUint(s string) uint32

ColorUint Turn an hex color string beginning with a # into a uint32 representing a color.

func MaxChar

func MaxChar(n int64) func(*Anilist)

MaxChar sets the maximum number of characters to return

func NoCache

func NoCache(a *Anilist)

NoCache disables the cache

Types

type Anilist

type Anilist struct {
	MaxChars int64
	// contains filtered or unexported fields
}

Anilist defines a common interface to interact with anilist

func New

func New(opts ...func(*Anilist)) *Anilist

New returns a new anilist client

func (*Anilist) Anime

func (a *Anilist) Anime(ctx context.Context, title string) ([]discord.Media, error)

Anime returns an anime by title

func (*Anilist) Character

func (a *Anilist) Character(ctx context.Context, name string) ([]discord.MediaCharacter, error)

Character returns a character by name

func (*Anilist) Manga

func (a *Anilist) Manga(ctx context.Context, title string) ([]discord.Media, error)

Manga returns a manga by title

func (*Anilist) RandomChar

func (a *Anilist) RandomChar(ctx context.Context, notIn ...int64) (discord.MediaCharacter, error)

RandomChar returns a random char

func (*Anilist) User

func (a *Anilist) User(ctx context.Context, name string) ([]discord.TrackerUser, error)

User returns a user by name

type MediaType

type MediaType string

Media type enum, anime or manga.

const (
	// Japanese Anime
	MediaTypeAnime MediaType = "ANIME"
	// Asian comic
	MediaTypeManga MediaType = "MANGA"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL