api

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewFDSClient

func NewFDSClient(url string) *Client

NewFDSClient creates a new client for the FDS API. For most cases, it is recommended to use the SetToken method soon after to set the token.

func (*Client) BotLogin

BotLogin is used to login the bot to the Discord API. No token is required for this endpoint.

func (*Client) Daily

func (c *Client) Daily(id string) (*DiscordMemberResponse, error)

Daily is used to claim the daily reward for a Discord user. The backend will return the user's updated stats. TODO: Add error docs

func (*Client) Leaderboard added in v0.4.0

func (c *Client) Leaderboard(page int) (*DiscordLeaderboardResponse, error)

Leaderboard is used to get the leaderboard for all verified Discord users. NOTE: The pagination uses zero-based indexing.

func (*Client) Member added in v0.4.0

func (c *Client) Member(id string) (*DiscordMemberResponse, error)

Member is used to get the stats for a specific Discord user.

func (*Client) SetToken

func (c *Client) SetToken(token string)

SetToken sets the token for the client. This token for is used for most endpoints.

func (*Client) Verify

Verify is used to link a Discord account to a Hypixel account. The backend will store a snapshot of the player's Hypixel stats and Mojang profile as well as store the Discord user.

type DiscordBotLoginRequest

type DiscordBotLoginRequest struct {
	Pwd string `json:"pwd" query:"pwd"`
}

type DiscordBotLoginResponse

type DiscordBotLoginResponse struct {
	Token string `json:"token"`
}

type DiscordLeaderboardResponse added in v0.4.0

type DiscordLeaderboardResponse []struct {
	DiscordID string  `json:"discord_id"`
	Level     int     `json:"level"`
	XP        float64 `json:"xp"`
}

type DiscordMemberResponse

type DiscordMemberResponse struct {
	model.DiscordMember
}

type DiscordVerifyRequest

type DiscordVerifyRequest struct {
	ID   string `json:"id"`
	Nick string `json:"nick"`
	Name string `json:"name"`
}

type DiscordVerifyResponse

type DiscordVerifyResponse struct {
	Actual string `json:"actual"`
}

Jump to

Keyboard shortcuts

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