api

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 3 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) 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 DiscordMemberResponse

type DiscordMemberResponse struct {
	DiscordID   string  `json:"discord_id"`
	Name        string  `json:"name"`
	Nick        string  `json:"nick"`
	XP          float64 `json:"xp"`
	LastDailyAt string  `json:"last_daily_at"`
	Level       int     `json:"level"`
	Streak      int     `json:"streak"`
}

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