myanimelist

package
v0.0.0-...-eb4b608 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Unlicense Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SynopsisThreshold = 250
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Anime

type Anime struct {
	ID          int    `json:"id"`
	Title       string `json:"title"`
	MainPicture struct {
		Medium string `json:"medium"`
		Large  string `json:"large"`
	} `json:"main_picture"`
	AlternativeTitles struct {
		Synonyms []string `json:"synonyms"`
		En       string   `json:"en"`
		Ja       string   `json:"ja"`
	} `json:"alternative_titles"`
	StartDate  string  `json:"start_date"`
	EndDate    string  `json:"end_date"`
	Synopsis   string  `json:"synopsis"`
	Mean       float64 `json:"mean"`
	Rank       int     `json:"rank"`
	Popularity int     `json:"popularity"`
	Nsfw       string  `json:"nsfw"`
	MediaType  string  `json:"media_type"`
	Status     string  `json:"status"`
	Genres     []struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"genres"`
	NumEpisodes int `json:"num_episodes"`
	StartSeason struct {
		Year   int    `json:"year"`
		Season string `json:"season"`
	} `json:"start_season"`
	AverageEpisodeDuration int `json:"average_episode_duration"`
	Studios                []struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"studios"`
}

func (*Anime) EndDateFormatted

func (a *Anime) EndDateFormatted() (string, error)

func (*Anime) GetAlternativeTitles

func (a *Anime) GetAlternativeTitles() []string

func (*Anime) GetMainPicture

func (a *Anime) GetMainPicture() string

func (*Anime) GetMediaType

func (a *Anime) GetMediaType() string

func (*Anime) GetSeason

func (a *Anime) GetSeason() string

func (*Anime) GetStatus

func (a *Anime) GetStatus() string

func (*Anime) NSFW

func (a *Anime) NSFW() bool

func (*Anime) StartDateFormatted

func (a *Anime) StartDateFormatted() (string, error)

type AnimeResult

type AnimeResult struct {
	ID    int    `json:"id"`
	Title string `json:"title"`
	Nsfw  string `json:"nsfw"`
}

AnimeResult is an extra struct because we don't need all the fields

func (*AnimeResult) NSFW

func (a *AnimeResult) NSFW() bool

type AnimeSearch

type AnimeSearch struct {
	Results []struct {
		Anime AnimeResult `json:"node"`
	} `json:"data"`
}

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func New

func New(credentialService model.CredentialService) *Plugin

func (*Plugin) Commands

func (p *Plugin) Commands() []telebot.Command

func (*Plugin) Handlers

func (p *Plugin) Handlers(botInfo *telebot.User) []plugin.Handler

func (*Plugin) Name

func (*Plugin) Name() string

Jump to

Keyboard shortcuts

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