config

package
v1.5.16 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TmpDir            = "/tmp/tmp.img"
	NotFound          = "https://cdn.human-z.tech/404.jpg"
	YoutubeIMG        = "https://cdn.human-z.tech/youtube.png"
	BiliBiliIMG       = "https://cdn.human-z.tech/bilibili.png"
	TwitterIMG        = "https://cdn.human-z.tech/twitter.png"
	WorryIMG          = "https://cdn.human-z.tech/parerunworry.png"
	GoSimpIMG         = "https://cdn.human-z.tech/go-simp.png"
	Longcatttt        = "https://cdn.ebaumsworld.com/2020/09/20/013235/86394200/longcat-pic.jpg"
	Dead              = "https://cdn.human-z.tech/dead.jpg"
	BSD               = "https://cdn.human-z.tech/bsd.png"
	Sleep             = "https://cdn.human-z.tech/sleep.png"
	Bonjour           = "https://cdn.human-z.tech/bonjour.png"
	Howdy             = "https://cdn.human-z.tech/howdy.png"
	Guten             = "https://cdn.human-z.tech/guten.png"
	Koni              = "https://cdn.human-z.tech/koni.png"
	Selamat           = "https://cdn.human-z.tech/selamat.jpg"
	Assalamu          = "https://cdn.human-z.tech/Assalamu.jpg"
	Approaching       = "https://cdn.human-z.tech/approaching.jpg"
	CommandURL        = "https://go-simp.human-z.tech/Exec/"
	VtubersData       = "https://go-simp.human-z.tech"
	ChannelPermission = 16

	//Crontab
	TwitterFanart        = "@every 0h7m0s"
	BiliBiliFanart       = "@every 0h6m0s"
	BiliBiliLive         = "@every 0h8m0s"
	BiliBiliSpace        = "@every 0h10m0s"
	YoutubeCheckChannel  = "@every 0h5m0s"
	YoutubePrivateSlayer = "@every 2h31m0s"
	YoutubeSubscriber    = "@every 1h0m0s"
	BiliBiliFollowers    = "@every 0h30m0s"
	TwitterFollowers     = "@every 0h17m0s"
	DonationMsg          = "@every 0h30m0s"
	CheckServerCount     = "@every 0h1m0s"
)

Variables

View Source
var (
	/*
		Token          string
		YtToken        []string
		EmojiFanart    []string
		EmojiStream    []string
		PFanart        string
		PYoutube       string
		PBilibili      string
		PGeneral       string
		TwitterToken   []string
		ImgurClient    string
		BiliBiliSes    string
		SauceAPI       string
		Logging        string
		DiscordWebHook string
		MultiTOR       string
		KoFiLink       string
	*/
	ModuleList  = []string{"LiveBiliBili", "SpaceBiliBili", "Youtube", "TwitterFanart", "BiliBiliFanart", "YoutubeSubscriber", "BiliBiliFollowers", "TwitterFollowers"}
	BotConf     ConfigFile
	TwitchToken string
)

Public variables

Functions

This section is empty.

Types

type ConfigFile

type ConfigFile struct {
	Discord        string   `toml:"Discord"`
	TwitterBearer  []string `toml:"TwitterBearer"`
	ImgurClinet    string   `toml:"ImgurClinet"`
	BiliSess       string   `toml:"BiliSess"`
	SauceAPI       string   `toml:"SauceAPI"`
	DiscordWebHook string   `toml:"DiscordWebHook"`
	MultiTOR       string   `toml:"Multitor"`
	DonationLink   string   `toml:"DonationLink"`
	TopGG          string   `toml:"TOPGG"`
	Twitch         struct {
		ClientID     string `toml:"ClientID"`
		ClientSecret string `toml:"ClientSecret"`
	} `toml:"Twitch"`
	LimitConf struct {
		TwitterFanart int `toml:"TwitterLimit"`
		SpaceBiliBili int `toml:"SpaceBiliBili"`
		YoutubeLimit  int `toml:"YoutubeLimit"`
	} `toml:"Limit"`
	SQL struct {
		User         string `toml:"User"`
		Pass         string `toml:"Pass"`
		Host         string `toml:"Host"`
		Port         string `toml:"Port"`
		MaxOpenConns int    `toml:"MaxOpenConns"`
		MaxIdleConns int    `toml:"MaxIdleConns"`
	} `toml:"Sql"`
	Cached struct {
		Host string `toml:"Host"`
		Port string `toml:"Port"`
	} `toml:"Cached"`
	BotPrefix struct {
		Fanart   string `toml:"Fanart"`
		Youtube  string `toml:"Youtube"`
		Bilibili string `toml:"Bilibili"`
		General  string `toml:"General"`
	} `toml:"BotPrefix"`
	Emoji struct {
		Fanart     []string `toml:"Fanart"`
		Livestream []string `toml:"Livestream"`
	} `toml:"Emoji"`
	YtToken []string `toml:"YoutubeToken"`
}

func ReadConfig

func ReadConfig(path string) (ConfigFile, error)

read from config file

func (ConfigFile) CheckSQL

func (Data ConfigFile) CheckSQL() *sql.DB

func (ConfigFile) GetTwitchAccessToken

func (Data ConfigFile) GetTwitchAccessToken() string

Jump to

Keyboard shortcuts

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