bot

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIURLSoTAchievements = "https://www.seaofthieves.com/api/profilev2/achievements"
	APIURLSoTAllegiance   = "https://www.seaofthieves.com/api/profilev2"
	APIURLSoTSeasons      = "https://www.seaofthieves.com/api/profilev2/seasons-progress"
	APIURLSoTUserBalance  = "https://www.seaofthieves.com/api/profilev2/balance"
	APIURLSoTReputation   = "https://www.seaofthieves.com/api/profilev2/reputation"
	APIURLSoTUserOverview = "https://www.seaofthieves.com/api/profilev2/overview"
	APIURLSoTEventHub     = "https://www.seaofthieves.com/event-hub"
	APIURLRTTradeRoutes   = "https://maps.seaofthieves.rarethief.com/js/trade_routes.js"
	APIURLSoTLedger       = "https://www.seaofthieves.com/api/ledger/friends"
	AssetsBaseURL         = "https://github.com/wneessen/arrgo/raw/main/assets"
)

List of Sea of Thieves API endpoints

View Source
const (
	ErrFailedHTTPClient          = "failed to generate new HTTP client: %s"
	ErrFailedRetrieveUserStatsDB = "failed retrieve user status from DB: %s"
	ErrFailedGuildLookupDB       = "failed to look up guild in database: %s"
	ErrFailedStringConvert       = "failed to convert string to int: %s"
)
View Source
const (
	// ErrMigrateCloseSourceConnection should be used when a SQL migration was not able to close the source
	ErrMigrateCloseSourceConnection = "failed to close sources connection for migrate: %s"
	// ErrMigrateCloseDBConnection should be used when migrate is unable to close the DB connection
	ErrMigrateCloseDBConnection = "failed to close DB connection for migrate: %s"
)
View Source
const (
	IconGold        = "\U0001F7E1"
	IconDoubloon    = "🔵"
	IconAncientCoin = "💰"
	IconIncrease    = "📈 "
	IconDecrease    = "📉 "
	IconArrowUp     = "⬆️ "
	IconArrowDown   = "⬇️ "
	IconKraken      = "🐙"
	IconMegalodon   = "🦈"
	IconChest       = "🗝️"
	IconShip        = "⛵"
	IconVomit       = "🤮"
	IconDistance    = "📐"
	IconGauge       = "🌡️"
	IconDuration    = "⏱️"
)

List of icons/emojis

View Source
const MigrationsPath = "file://sql_migrations"

MigrationsPath defines the path where to find the sql_migrations

View Source
const SOTReferer = "https://www.seaofthieves.com/profile/achievements"

SOTReferer is the referer that apparently is needed for the SoT API to accept requests

View Source
const (
	TitleConfigUpdated = "Bot configuration updated"
)
View Source
const Version = "0.3.2"

Variables

View Source
var (
	ErrUserNotRegistered = errors.New("your user is not registered with the bot. Please use the " +
		"**/register** command to activate the full feature set first")
	ErrUserHasNoRATCookie = errors.New("you have not provided a Sea of Thieves authentication token. " +
		"Please store your cookie with the **/setrat** command first")
	ErrRATCookieExpired = errors.New("your Sea of Thieves authentication token is expired. " +
		"Please use the **/setrat** command to update your token")
	ErrMemberNil = errors.New("provided Member pointer must not be nil")
	ErrUserNil   = errors.New("provided User pointer must not be nil")
)

List of Requester specific errors

View Source
var (
	// ErrSOTUnauth should be used when requrests to the SoT API were not successful due to expired
	// tokens
	ErrSOTUnauth = errors.New("failed to fetch Sea of Thieves content, due to being unauthorized")
)

HTTP client related errors

Functions

This section is empty.

Types

type APIIntString

type APIIntString int64

APIIntString represents a API response string that is actually a Integer

func (*APIIntString) UnmarshalJSON

func (s *APIIntString) UnmarshalJSON(ib []byte) error

UnmarshalJSON converts the APIIntString string into an int64

type APITimeRFC3339 added in v0.1.6

type APITimeRFC3339 time.Time

APITimeRFC3339 is a wrapper type for time.Time

func (*APITimeRFC3339) UnmarshalJSON added in v0.1.6

func (t *APITimeRFC3339) UnmarshalJSON(s []byte) error

UnmarshalJSON converts a API RFC3339 formated date strings into a time.Time object

type Bot

type Bot struct {
	Log     zerolog.Logger
	Config  *config.Config
	Session *discordgo.Session
	Model   model.Model
	// contains filtered or unexported fields
}

Bot represents the bot instance

func New

func New(l zerolog.Logger, c *config.Config) (*Bot, error)

New initializes a new Bot instance

func (*Bot) CheckDBVersion

func (b *Bot) CheckDBVersion(c *config.Config) (uint, error)

CheckDBVersion compares the DB version with the SQL migrations

func (*Bot) GuildCreate

func (b *Bot) GuildCreate(s *discordgo.Session, ev *discordgo.GuildCreate)

GuildCreate receives GUILD_CREATE updates from each server the bot is connected to

func (*Bot) GuildDelete

func (b *Bot) GuildDelete(_ *discordgo.Session, ev *discordgo.GuildDelete)

GuildDelete receives GUILD_DELETE updates from each server the bot is connected to

func (*Bot) NewRequester

func (b *Bot) NewRequester(i *discordgo.Interaction) (*Requester, error)

NewRequester returns a Requester based on if it's a channel interaction or DM

func (*Bot) OpenDB

func (b *Bot) OpenDB(c *config.Config) (*sql.DB, error)

OpenDB tries to connect to the SQLite file and returns the sql.DB pointer

func (*Bot) RTGetTradeRoutes

func (b *Bot) RTGetTradeRoutes() (RTTraderoute, error)

RTGetTradeRoutes returns the parsed API response from the rarethief.com traderoutes API

func (*Bot) ReadyHandler

func (b *Bot) ReadyHandler(s *discordgo.Session, ev *discordgo.Ready)

ReadyHandler updates the Bot's session data

func (*Bot) RegisterSlashCommands

func (b *Bot) RegisterSlashCommands() error

RegisterSlashCommands will fetch the list of available slash commands and register them with the Guild if not present yet

func (*Bot) RemoveSlashCommands

func (b *Bot) RemoveSlashCommands() error

RemoveSlashCommands will fetch the list of registered slash commands and remove them

func (*Bot) Run

func (b *Bot) Run() error

Run executes the Bot's main loop

func (*Bot) SQLDowngrade

func (b *Bot) SQLDowngrade(c *config.Config) error

SQLDowngrade migrates the database to the latest SQL set

func (*Bot) SQLMigrate

func (b *Bot) SQLMigrate(c *config.Config) error

SQLMigrate migrates the database to the latest SQL set

func (*Bot) ScheduledEventCheckRATCookies

func (b *Bot) ScheduledEventCheckRATCookies() error

ScheduledEventCheckRATCookies performs scheuled checks if the provided RAT cookies are still valid

func (*Bot) ScheduledEventSoTFlameheart

func (b *Bot) ScheduledEventSoTFlameheart() error

ScheduledEventSoTFlameheart performs scheuled FH spam message to the guilds system channel

func (*Bot) ScheduledEventUpdateDailyDeeds added in v0.1.6

func (b *Bot) ScheduledEventUpdateDailyDeeds() error

ScheduledEventUpdateDailyDeeds performs scheuled updates of the SoT daily deeds

func (*Bot) ScheduledEventUpdateTradeRoutes

func (b *Bot) ScheduledEventUpdateTradeRoutes() error

ScheduledEventUpdateTradeRoutes performs scheuled updates of the TR data from rarethief.com

func (*Bot) ScheduledEventUpdateUserReputation added in v0.2.8

func (b *Bot) ScheduledEventUpdateUserReputation() error

ScheduledEventUpdateUserReputation performs scheuled updates of the SoT user reputation for each user

func (*Bot) ScheduledEventUpdateUserStats

func (b *Bot) ScheduledEventUpdateUserStats() error

ScheduledEventUpdateUserStats performs scheuled updates of the SoT user stats for each user

func (*Bot) SlashCmdConfig

func (b *Bot) SlashCmdConfig(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdConfig handles the /config slash command All /config commands require admin or moderate-members permissions on the guild

func (*Bot) SlashCmdRegister

func (b *Bot) SlashCmdRegister(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdRegister handles the /register slash command

func (*Bot) SlashCmdSetRAT

func (b *Bot) SlashCmdSetRAT(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSetRAT handles the /setrat slash command

func (*Bot) SlashCmdSoTAchievement

func (b *Bot) SlashCmdSoTAchievement(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTAchievement handles the /achievement slash command

func (*Bot) SlashCmdSoTAllegiance added in v0.2.5

func (b *Bot) SlashCmdSoTAllegiance(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTAllegiance handles the /allegiance slash command

func (*Bot) SlashCmdSoTBalance

func (b *Bot) SlashCmdSoTBalance(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTBalance handles the /balance slash command

func (*Bot) SlashCmdSoTCompare added in v0.1.5

func (b *Bot) SlashCmdSoTCompare(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTCompare handles the /compare slash command

func (*Bot) SlashCmdSoTDailyDeeds added in v0.1.6

func (b *Bot) SlashCmdSoTDailyDeeds(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTDailyDeeds handles the /dailydeed slash command

func (*Bot) SlashCmdSoTFlameheart

func (b *Bot) SlashCmdSoTFlameheart(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTFlameheart handles the /flameheart slash command

func (*Bot) SlashCmdSoTLedger added in v0.1.7

func (b *Bot) SlashCmdSoTLedger(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTLedger handles the /ledger slash command

func (*Bot) SlashCmdSoTOverview

func (b *Bot) SlashCmdSoTOverview(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTOverview handles the /balance slash command

func (*Bot) SlashCmdSoTReputation added in v0.2.8

func (b *Bot) SlashCmdSoTReputation(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTReputation handles the /reputation slash command

func (*Bot) SlashCmdSoTSeasonProgress

func (b *Bot) SlashCmdSoTSeasonProgress(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTSeasonProgress handles the /season slash command

func (*Bot) SlashCmdSoTTradeRoutes

func (b *Bot) SlashCmdSoTTradeRoutes(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdSoTTradeRoutes handles the /balance slash command

func (*Bot) SlashCmdTime

func (b *Bot) SlashCmdTime(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdTime handles the /time slash command

func (*Bot) SlashCmdUptime

func (b *Bot) SlashCmdUptime(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdUptime handles the /uptime slash command

func (*Bot) SlashCmdVersion

func (b *Bot) SlashCmdVersion(s *discordgo.Session, i *discordgo.InteractionCreate) error

SlashCmdVersion handles the /version slash command

func (*Bot) SlashCommandHandler

func (b *Bot) SlashCommandHandler(s *discordgo.Session, i *discordgo.InteractionCreate)

SlashCommandHandler is the central handler method for all slash commands. It will look up the name of the received SC-handler event in a map and when found execute the corresponding method

func (*Bot) SoTGetAchievements

func (b *Bot) SoTGetAchievements(rq *Requester) (SoTAchievementList, error)

SoTGetAchievements returns the parsed API response from the Sea of Thieves achievements API

func (*Bot) SoTGetAllegiance added in v0.2.5

func (b *Bot) SoTGetAllegiance(rq *Requester, at string) (SoTAllegiance, error)

SoTGetAllegiance returns the parsed API response from the Sea of Thieves allegiance API

func (*Bot) SoTGetDailyDeeds added in v0.1.6

func (b *Bot) SoTGetDailyDeeds() ([]SoTDeed, error)

SoTGetDailyDeeds returns the parsed API response from the Sea of Thieves event-hub API

func (*Bot) SoTGetLedger added in v0.1.7

func (b *Bot) SoTGetLedger(rq *Requester, em string) (SoTEmissaryLedger, error)

SoTGetLedger returns the parsed API response from the Sea of Thieves leaderboard ledger API

func (*Bot) SoTGetReputation added in v0.2.8

func (b *Bot) SoTGetReputation(rq *Requester) (SoTReputation, error)

SoTGetReputation returns the parsed API response from the Sea of Thieves reputation API

func (*Bot) SoTGetSeasonProgress

func (b *Bot) SoTGetSeasonProgress(rq *Requester) (SoTSeasonList, error)

SoTGetSeasonProgress returns the parsed API response from the Sea of Thieves season progress API

func (*Bot) SoTGetUserBalance

func (b *Bot) SoTGetUserBalance(rq *Requester) (SoTUserBalance, error)

SoTGetUserBalance returns the parsed API response from the Sea of Thieves gold/coins balance API

func (*Bot) SoTGetUserOverview

func (b *Bot) SoTGetUserOverview(rq *Requester) (SoTUserStats, error)

SoTGetUserOverview returns the parsed API response from the Sea of Thieves gold/coins balance API

func (*Bot) StartTimeString

func (b *Bot) StartTimeString() string

StartTimeString returns the time when the bot was last initialized

func (*Bot) StartTimeUnix

func (b *Bot) StartTimeUnix() int64

StartTimeUnix returns the time when the bot was last initialized

func (*Bot) StoreSoTUserReputation added in v0.2.8

func (b *Bot) StoreSoTUserReputation(u *model.User) error

StoreSoTUserReputation will retrieve the latest user reputation from the API and store them in the DB

func (*Bot) StoreSoTUserStats

func (b *Bot) StoreSoTUserStats(rq *Requester) error

StoreSoTUserStats will retrieve the latest user stats from the API and store them in the DB

func (*Bot) UserPlaySoT

func (b *Bot) UserPlaySoT(_ *discordgo.Session, ev *discordgo.PresenceUpdate)

UserPlaySoT receives PRESENCE_UPDATE from each server and handles if the user starts playing SoT

type HTTPClient

type HTTPClient struct {
	*http.Client
}

HTTPClient is an object wrapper for the Go http.Client

func NewHTTPClient

func NewHTTPClient() (*HTTPClient, error)

NewHTTPClient returns a HTTPClient object

func (*HTTPClient) Fetch

func (h *HTTPClient) Fetch(r *HTTPRequest) ([]byte, *http.Response, error)

Fetch performs the actual HTTP request

func (*HTTPClient) HTTPReq added in v0.1.9

func (h *HTTPClient) HTTPReq(p string, m HTTPReqMethod, q map[string]string) (*HTTPRequest, error)

HTTPReq generates a HTTPRequest based on the Request method and request URI

type HTTPReqMethod

type HTTPReqMethod string

HTTPReqMethod is a wrapper around a string

const (
	// ReqMethodGet is the GET request method
	ReqMethodGet HTTPReqMethod = "GET"

	// ReqMethodPost is the POST request method
	ReqMethodPost HTTPReqMethod = "POST"
)

List of HTTPReqMethods

type HTTPRequest

type HTTPRequest struct {
	*http.Request
}

HTTPRequest is an object wrapper for the Go http.Request

func (*HTTPRequest) SetReferer

func (r *HTTPRequest) SetReferer(rf string)

SetReferer sets a custom referer to the request

func (*HTTPRequest) SetSOTRequest

func (r *HTTPRequest) SetSOTRequest(c string)

SetSOTRequest sets the required additional headers for Sea of Thieves API requests

type RTRoute

type RTRoute struct {
	Outpost     string `json:"outpost"`
	SoughtAfter string `json:"sought_after"`
	Surplus     string `json:"surplus"`
}

RTRoute represents the JSON structure of a specific route within the rarethief.com traderoutes API response

type RTTraderoute

type RTTraderoute struct {
	Dates     string             `json:"trade_route_dates"`
	Routes    map[string]RTRoute `json:"routes"`
	ValidFrom time.Time
	ValidThru time.Time
}

RTTraderoute represents the JSON structure of the rarethief.com traderoute API response

type Requester

type Requester struct {
	*discordgo.Member
	*model.UserModel
	*model.User
}

Requester wraps the discordgo.Member object to extend its functionality

func NewRequesterFromMember added in v0.2.3

func NewRequesterFromMember(m *discordgo.Member, um *model.UserModel) (*Requester, error)

NewRequesterFromMember returns a new *Requester pointer from a given *discordgo.Member

func NewRequesterFromUser added in v0.2.3

func NewRequesterFromUser(u *model.User, um *model.UserModel) (*Requester, error)

NewRequesterFromUser returns a new *Requester pointer from a given *model.User

func (*Requester) CanModerateMembers

func (r *Requester) CanModerateMembers() bool

CanModerateMembers returns true if the Requester has moderator permissions on the guild

func (*Requester) GetSoTRATCookie

func (r *Requester) GetSoTRATCookie() (string, error)

GetSoTRATCookie checks if the Requester has a SoT RAT cookie and reads it from the DB

func (*Requester) IsAdmin

func (r *Requester) IsAdmin() bool

IsAdmin returns true if the Requester has administrative permissions on the guild

type SoTAchievement

type SoTAchievement struct {
	Sort        int    `json:"Sort"`
	Name        string `json:"Name"`
	Description string `json:"Description"`
	MediaURL    string `json:"MediaUrl"`
}

SoTAchievement is a single achievement in the Sea of Thieves achievements API response

type SoTAchievementList

type SoTAchievementList struct {
	Sorted []SoTSortedAchievement `json:"sorted"`
}

SoTAchievementList represents the JSON structure of the Sea of Thieves achievements API response

type SoTAllegiance added in v0.2.5

type SoTAllegiance struct {
	Allegiance string
	ShipsSunk  int64
	MaxStreak  int64
	TotalGold  int64
	Icon       string
}

SoTAllegiance is the struct that represents the parsed data from the API endpoint

type SoTAllegianceJSON added in v0.2.5

type SoTAllegianceJSON struct {
	Stats []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"stats"`
}

SoTAllegianceJSON is the nested struct from the Sea of Thieves event hub response

type SoTCurrentLedger added in v0.1.7

type SoTCurrentLedger struct {
	Friends SoTFriendsLedger `json:"friends"`
}

SoTCurrentLedger represents the JSON structure of the Sea of Thieves current leder within the overall ledger response

type SoTDeed added in v0.1.6

type SoTDeed struct {
	Type         string          `json:"#Type"`
	Title        string          `json:"Title"`
	BodyText     string          `json:"BodyText"`
	StartDateAPI *APITimeRFC3339 `json:"StartDate,omitempty"`
	EndDateAPI   *APITimeRFC3339 `json:"EndDate,omitempty"`
	Image        struct {
		Desktop string `json:"desktop"`
	} `json:"Image"`
	RewardDetails struct {
		Gold      int    `json:"Gold"`
		Doubloons int    `json:"Doubloons"`
		XPGain    string `json:"XPGain"`
	} `json:"RewardDetails"`
}

SoTDeed is a deed as returned by the events-hub in Sea of Thieves

type SoTEmissaryLedger added in v0.1.7

type SoTEmissaryLedger struct {
	Name       string
	Band       int `json:"band"`
	BandTitle  string
	Rank       int `json:"rank"`
	Score      int `json:"score"`
	ToNextRank int `json:"toNextRank"`
}

SoTEmissaryLedger represents the JSON structure of the Sea of Thieves ledger data

type SoTEventHubJSON added in v0.1.6

type SoTEventHubJSON struct {
	Data struct {
		Components []struct {
			Data struct {
				BountyList []SoTDeed `json:"BountyList"`
			} `json:"data"`
		} `json:"components"`
	} `json:"data"`
}

SoTEventHubJSON is the nested struct from the Sea of Thieves event hub response

type SoTFactionNextLevel added in v0.2.8

type SoTFactionNextLevel struct {
	Level      int64 `json:"Level"`
	XPRequired int64 `json:"XpRequiredToAttain"`
}

SoTFactionNextLevel represents XP level information of the JSON structure of the Sea of Thieves reputation within a season API response

type SoTFactionReputation added in v0.2.8

type SoTFactionReputation struct {
	Name             string
	Motto            string              `json:"Motto"`
	Rank             string              `json:"Rank"`
	Level            int64               `json:"Level"`
	Experience       int64               `json:"XP"`
	NextCompanyLevel SoTFactionNextLevel `json:"NextCompanyLevel"`
	TitlesTotal      int64               `json:"TitlesTotal"`
	TitlesUnlocked   int64               `json:"TitlesUnlocked"`
	EmblemsTotal     int64               `json:"EmblemsTotal"`
	EmblemsUnlocked  int64               `json:"EmblemsUnlocked"`
	ItemsTotal       int64               `json:"ItemsTotal"`
	ItemsUnlocked    int64               `json:"ItemsUnlocked"`
}

SoTFactionReputation represents second level of the JSON structure of the Sea of Thieves reputation within a season API response

type SoTFriendsLedger added in v0.1.7

type SoTFriendsLedger struct {
	User SoTEmissaryLedger `json:"user"`
}

SoTFriendsLedger represents the JSON structure of the Sea of Thieves friends positioning withing the current leder

type SoTLedger added in v0.1.7

type SoTLedger struct {
	Current SoTCurrentLedger `json:"current"`
}

SoTLedger represents the JSON structure of the Sea of Thieves leder positions within a season API response

type SoTRATCookie

type SoTRATCookie struct {
	Value      string `json:"Value"`
	Expiration int64  `json:"Expiration"`
}

SoTRATCookie represents the JSON formated Sea of Thieves authentication cookie

type SoTReputation added in v0.2.8

type SoTReputation map[string]SoTFactionReputation

SoTReputation represents first level of the JSON structure of the Sea of Thieves reputation within a season API response

type SoTSeasonLevel

type SoTSeasonLevel struct {
	Number  int              `json:"Number"`
	Rewards SoTSeasonRewards `json:"RewardsV2"`
}

SoTSeasonLevel represents the JSON structure of the Sea of Thieves seasons levels within the season progress API response

type SoTSeasonList

type SoTSeasonList []SoTSeasonProgress

SoTSeasonList represents the JSON structure of the Sea of Thieves seasons API response

type SoTSeasonProgress

type SoTSeasonProgress struct {
	LevelProgress       float64         `json:"LevelProgress"`
	Tier                int             `json:"Tier"`
	SeasonTitle         string          `json:"Title"`
	TotalChallenges     int             `json:"TotalChallenges"`
	CompletedChallenges int             `json:"CompleteChallenges"`
	Tiers               []SoTSeasonTier `json:"Tiers"`
	CDNPath             string          `json:"CdnPath"`
}

SoTSeasonProgress represents the JSON structure of the Sea of Thieves seasons progress within a season API response

type SoTSeasonReward

type SoTSeasonReward struct {
	CurrencyType           string `json:"CurrencyType"`
	Locked                 bool   `json:"Locked"`
	Owned                  bool   `json:"Owned"`
	EntitlementURL         string `json:"EntitlementUrl"`
	EntitlementText        string `json:"EntitlementText"`
	EntitlementDescription string `json:"EntitlementDescription"`
}

SoTSeasonReward represents the JSON structure of the Sea of Thieves seasons reward in the level within the season progress API response

type SoTSeasonRewards

type SoTSeasonRewards struct {
	Base       []SoTSeasonReward `json:"Base"`
	Legendary  []SoTSeasonReward `json:"Legendary"`
	SeasonPass []SoTSeasonReward `json:"SeasonPass"`
}

SoTSeasonRewards represents the JSON structure of the Sea of Thieves seasons rewards collection within the season progress API response

type SoTSeasonTier

type SoTSeasonTier struct {
	Number int              `json:"Number"`
	Title  string           `json:"Title"`
	Levels []SoTSeasonLevel `json:"Levels"`
}

SoTSeasonTier represents the JSON structure of the Sea of Thieves seasons tier within the season progress API response

type SoTSortedAchievement

type SoTSortedAchievement struct {
	Achievement SoTAchievement `json:"achievement"`
}

SoTSortedAchievement is a subpart of the Sea of Thieves achievements API response

type SoTUserBalance

type SoTUserBalance struct {
	GamerTag     string `json:"gamertag"`
	Title        string `json:"title"`
	Doubloons    int64  `json:"doubloons"`
	Gold         int64  `json:"gold"`
	AncientCoins int64  `json:"ancientCoins"`
}

SoTUserBalance represents the JSON structure of the Sea of Thieves user balance API response

type SoTUserOverview

type SoTUserOverview struct {
	Stats SoTUserStats `json:"stats"`
}

SoTUserOverview represents the JSON structure of the Sea of Thieves user overview API response

type SoTUserStats

type SoTUserStats struct {
	KrakenDefeated      APIIntString `json:"Combat_Kraken_Defeated"`
	MegalodonEncounters APIIntString `json:"Player_TinyShark_Spawned"`
	ChestsHandedIn      APIIntString `json:"Chests_HandedIn_Total"`
	ShipsSunk           APIIntString `json:"Combat_Ships_Sunk"`
	VomitedTotal        APIIntString `json:"Vomited_Total"`
	MetresSailed        APIIntString `json:"Voyages_MetresSailed_Total"`
}

SoTUserStats represents a subpart of the JSON structure of the Sea of Thieves user overview API response

Jump to

Keyboard shortcuts

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