common

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VERSION = "v0.0.0"
	PQ      *sql.DB

	SuccessGreen = 0x00ff7b
	ErrorRed     = 0xFF0000

	Session *discordgo.Session
	Bot     *discordgo.User
)
View Source
var (
	ConfigBotToken    = os.Getenv("SUMMIT_TOKEN")
	ConfigBotClientID = os.Getenv("SUMMIT_CLIENTID")
	ConfigBotSecret   = os.Getenv("SUMMIT_CLIENTSECRET")

	ConfigPGHost     = os.Getenv("SUMMIT_PGHOST")
	ConfigPGDB       = os.Getenv("SUMMIT_PGDB")
	ConfigPGUsername = os.Getenv("SUMMIT_PGUSER")
	ConfigPGPassword = os.Getenv("SUMMIT_PGPASSWORD")

	ConfigSummitHost         = os.Getenv("SUMMIT_HOST")
	ConfigTermsURLOverride   = os.Getenv("SUMMIT_TERMSURLOVERRIDE")
	ConfigPrivacyURLOverride = os.Getenv("SUMMIT_PRIVACYURLOVERRIDE")

	ConfigBotOwner  = os.Getenv("SUMMIT_OWNERID")
	ConfigSupportID = os.Getenv("SUMMIT_SERVERID")

	ConfigGitHubRepo      = os.Getenv("SUMMIT_GITHUBREPO")
	ConfigGitHubRepoOwner = os.Getenv("SUMMIT_GITHUBREPOOWNER")
)
View Source
var CoreSchema = []string{`
CREATE TABLE IF NOT EXISTS core_config (
	guild_id TEXT PRIMARY KEY,
	guild_prefix TEXT DEFAULT '~' NOT NULL
);
`, `
CREATE TABLE IF NOT EXISTS banned_guilds (
	guild_id TEXT PRIMARY KEY
);
`,
}

Functions

func ConfigDgoBotToken

func ConfigDgoBotToken() string

ConfigDgoBotToken prefixes the bot token with the required "Bot " if it is not done by the host

func Init

func Init() error

Init creates a new discord session, attempts to connect to the postgres database, and intialises all the databases

func InitSchema

func InitSchema(schemaname string, schemas ...string)

InitSchema initialises the schemas passed to the bot

func Run

func Run(s *discordgo.Session)

Run connects the bot account to the Discord session

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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