league

package
v0.0.0-...-a9c0f70 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChampionsAvailable

func ChampionsAvailable() ([]string, []string)

func CleanCache

func CleanCache()

func CloseSession

func CloseSession()

func DisableTrackOnServer

func DisableTrackOnServer(channel string)

Remove a Discord server from the database.

func HasGameEnded

func HasGameEnded(lg []LiveGame, accs []Account) (l []LiveGame, a []Account)

func IsLiveGame

func IsLiveGame(run *sync.WaitGroup)

func IsNew

func IsNew(region, nickname, typo string) (resp bool)

func IsTracked

func IsTracked(region, nickname, channel string) (resp bool)

func LoadAllLiveGame

func LoadAllLiveGame(typo string, posted bool) (lg []LiveGame, accs []Account)

Load all live game data from the database.

func LoadData

func LoadData()

Load the required League of Legends data to use the League API.

func LoadFreeList

func LoadFreeList()

func LoadLocal

func LoadLocal(path string, i interface{})

Load from local.

func OpenSession

func OpenSession()

func SearchAccount

func SearchAccount(region, nickname, class string) (resp bool)

func ServerIsRegistred

func ServerIsRegistred(guild string) (proceeds bool, channel string)

Check to see if a Discord server is stored in the database.

func ShowAccountInfo

func ShowAccountInfo(region, nickname string) ([]string, string, string)

func ShowAccountMastery

func ShowAccountMastery(region, compressed_nick string, level int) ([]string, []string, int)

func ShowLeaderboard

func ShowLeaderboard(channel string) (des, res []string, valid bool)

func ShowLiveGame

func ShowLiveGame(region, id string) (des, red, blu []string)

func ShowPostGame

func ShowPostGame(region, match, id string) (des, data, ban, p []string, aes []int)

func Tables

func Tables()

func TrackAttach

func TrackAttach(region, compacted_account, channel string) string

func TrackConfig

func TrackConfig(guild, channel string)

func TrackRemove

func TrackRemove(region, compacted_account, channel string) string

Types

type Account

type Account struct {
	ID            string `json:"id"`
	AccountID     string `json:"accountId"`
	Puuid         string `json:"puuid"`
	Name          string `json:"name"`
	ProfileIconID int    `json:"profileIconId"`
	RevisionDate  int64  `json:"revisionDate"`
	SummonerLevel int    `json:"summonerLevel"`
	Continent     string
	Region        string
	Channel       string
	TrackID       string
}

type AccountRank

type AccountRank struct {
	LeagueID     string `json:"leagueId"`
	QueueType    string `json:"queueType"`
	Icon         string
	Tier         string `json:"tier"`
	SubTier      string `json:"rank"`
	Name         string
	SummonerID   string `json:"summonerId"`
	LeaguePoints int    `json:"leaguePoints"`
	Wins         int    `json:"wins"`
	Losses       int    `json:"losses"`
	HotStreak    bool   `json:"hotStreak"`
	Team         int
	MiniSeries   struct {
		Target   int    `json:"target"`
		Wins     int    `json:"wins"`
		Losses   int    `json:"losses"`
		Progress string `json:"progress"`
	} `json:"miniSeries,omitempty"`
}

type Data

type Data struct {
	DataItem map[string]Item `json:"data"`
}

type FreeChampion

type FreeChampion struct {
	FreeChampionId             []int `json:"freeChampionIds"`
	FreeChampionIdForNewPlayer []int `json:"freeChampionIdsForNewPlayers"`
	MaxNewPlayerLevel          int   `json:"maxNewPlayerLevel"`
}

type Item

type Item struct {
	Icon     string    `json:"ico"`
	Name     string    `json:"id"`
	ID       StringInt `json:"key"`
	FullName string    `json:"name"`
	Image    struct {
		Full string `json:"full"`
	} `json:"image"`
}

type LiveGame

type LiveGame struct {
	GameID            int              `json:"gameId"`
	GameQueueConfigID int              `json:"gameQueueConfigId"`
	PlatformID        string           `json:"platformId"`
	Participants      []LiveGamePlayer `json:"participants"`
	BannedChampions   []LiveGameBan    `json:"bannedChampions"`
	ChannelID         string
	GuildID           string
	MessageID         string
	ID                string
	On                bool
}

func (LiveGame) Remove

func (lg LiveGame) Remove(summoner string)

Remove a live game from the database.

func (LiveGame) Update

func (lg LiveGame) Update(summonerId, messageId string)

Send updated live game information to the database.

type LiveGameBan

type LiveGameBan struct {
	ChampionID int `json:"championId"`
	TeamID     int `json:"teamId"`
}

type LiveGamePlayer

type LiveGamePlayer struct {
	TeamID     int    `json:"teamId"`
	ChampionID int    `json:"championId"`
	SummonerID string `json:"summonerId"`
}

type Mastery

type Mastery struct {
	ChampionID     int    `json:"championId"`
	ChampionLevel  int    `json:"championLevel"`
	ChampionPoints int    `json:"championPoints"`
	LastPlayTime   int64  `json:"lastPlayTime"`
	SummonerID     string `json:"summonerId"`
}

type Match

type Match struct {
	Metadata struct {
		MatchID string `json:"matchId"`
	} `json:"metadata"`
	Info struct {
		Duration     int64    `json:"gameDuration"`
		Participants []Player `json:"participants"`
		QueueID      int      `json:"queueId"`
		Teams        []struct {
			Bans   []LiveGameBan `json:"bans"`
			TeamID int           `json:"teamId"`
		} `json:"teams"`
	} `json:"info"`
}

type Player

type Player struct {
	SummonerID   string    `json:"summonerId"`
	SummonerName string    `json:"summonerName"`
	ChampionId   StringInt `json:"championId"`
	ChampionName string    `json:"championName"`
	Kill         int       `json:"kills"`
	Death        int       `json:"deaths"`
	Assist       int       `json:"assists"`
	Item0        int       `json:"item0"`
	Item1        int       `json:"item1"`
	Item2        int       `json:"item2"`
	Item3        int       `json:"item3"`
	Item4        int       `json:"item4"`
	Item5        int       `json:"item5"`
	Item6        int       `json:"item6"`
	D            int       `json:"summoner1Id"`
	F            int       `json:"summoner2Id"`
	Win          bool      `json:"win"`
	Perks        struct {
		Styles []PostRunes `json:"styles"`
	} `json:"perks"`
}

type PostRunes

type PostRunes struct {
	Style      int `json:"style"`
	Selections []struct {
		Perk int `json:"perk"`
	} `json:"selections"`
}

type Queue

type Queue struct {
	QueueID     int    `json:"queueId"`
	Map         string `json:"map"`
	Description string `json:"description"`
}

type Rank

type Rank struct {
	Icon string `json:"ico"`
	Tier string `json:"tier"`
}

type RiotAPI

type RiotAPI struct {
	N struct {
		Item        string `json:"item"`
		Rune        string `json:"rune"`
		Mastery     string `json:"mastery"`
		Summoner    string `json:"summoner"`
		Champion    string `json:"champion"`
		Profileicon string `json:"profileicon"`
		Map         string `json:"map"`
		Language    string `json:"language"`
		Sticker     string `json:"sticker"`
	} `json:"n"`
	Version string `json:"v"`
	Cdn     string `json:"cdn"`
}
var (
	L RiotAPI
)

type Rune

type Rune struct {
	Icon  string `json:"ico"`
	Name  string `json:"name"`
	ID    int    `json:"id"`
	Slots []struct {
		Runes []Rune `json:"runes"`
	} `json:"slots"`
}

type Server

type Server struct {
	GuildID   string
	ChannelID string
}

func LoadAllServerDB

func LoadAllServerDB() (servers []Server)

Load all servers from the database.

type StringInt

type StringInt int

func (*StringInt) UnmarshalJSON

func (st *StringInt) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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