Skip to content

itsbradn/govalo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoValo

GoValo is a Valorant Client API library built for go. Designed for simplicity and ease of use you can get up in running in a few lines of code.

⚡️ Get Started

package main

import (
	"fmt"

	"github.com/itsbradn/govalo"
)

func main() {
	api, err := govalo.Setup("na", USERNAME, PASSWORD)

	if err != nil {
		fmt.Print(err)
		return
	}

	userinfo, err := valapi.GetUserInfo()

	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Printf("%s#%s\n", userinfo.Account.GameName, userinfo.Account.TagLine)
}

🎯 Endpoints

Match History

func main() {
	api, err := govalo.Setup("na", USERNAME, PASSWORD)
	if err != nil {
		fmt.Print(err)
		return
	}

	userinfo, err := valapi.GetUserInfo()
	if err != nil {
		fmt.Print(err)
		return
	}

	history, err := valapi.GetMatchHistory(userinfo.PlayerUUID, &govalo.MatchHistoryOptions{
		StartIndex: 0
		EndIndex:   5
	})
	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Printf("Most recent match: %s\n", history.History[0].MatchID)
}

Competitive Updates

func main() {
	api, err := govalo.Setup("na", USERNAME, PASSWORD)
	if err != nil {
		fmt.Print(err)
		return
	}

	userinfo, err := valapi.GetUserInfo()
	if err != nil {
		fmt.Print(err)
		return
	}

	competitiveUpdates, err := valapi.GetCompetitiveUpdates(userinfo.PlayerUUID, &govalo.CompetitiveUpdatesOptions{
		StartIndex: 0
		EndIndex:   5
	})
	if err != nil {
		fmt.Print(err)
		return
	}

	fmt.Printf("Most recent competitive update: %s\n", competitiveUpdates.Matches[0])
}