config

package
v0.0.0-...-1120f02 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Discord  *Discord `json:"discord"`
	Mongo    *Mongo   `json:"mongo"`
	Repost   *Repost  `json:"repost"`
	Pixiv    *Pixiv   `json:"pixiv"`
	SauceNAO string   `json:"saucenao"`
	Sentry   string   `json:"sentry"`
	Quotes   []*Quote `json:"quotes"`
	// contains filtered or unexported fields
}

Config is an application configuration struct.

func FromFile

func FromFile(path string) (*Config, error)

func (*Config) RandomQuote

func (c *Config) RandomQuote(nsfw bool) string

type Discord

type Discord struct {
	Token    string `json:"token"`
	AuthorID string `json:"author_id"`
}

Discord stores Discord bot configuration. Acquire bot token on Discord's Developer Portal. Prefixes must be below 5 characters each. AuthorID is required to enable developer commands. Empty AuthorID may lead to undefined behavior.

type Mongo

type Mongo struct {
	URI      string `json:"uri"`
	Database string `json:"default_db"`
}

Mongo stores Mongo connection configuration. Required.

type Pixiv

type Pixiv struct {
	AuthToken    string `json:"auth_token"`
	RefreshToken string `json:"refresh_token"`
	ProxyHost    string `json:"proxy_host"`
}

Pixiv stores Pixiv login information. Guide how to acquire auth and refresh tokens: https://gist.github.com/upbit/6edda27cb1644e94183291109b8a5fde

type Quote

type Quote struct {
	Content string `json:"content"`
	NSFW    bool   `json:"nsfw"`
}

Quote is a message shown in Boe Tea's embeds, selected randomly. If empty, footer will always be empty.

type Repost

type Repost struct {
	Type     string `json:"type"`
	RedisURI string `json:"redis_uri"`
}

Repost stores repost detector configuration. Supported types: "memory", "redis". RedisURI is not required for in-memory storage.

Jump to

Keyboard shortcuts

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