common

package
v0.0.0-...-e364c34 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const OpenApplication = "open_application"

OpenApplication is the custom ID used for the "open application" button

Variables

View Source
var Log = zap.S()

Log is the global logger.

View Source
var Version = ""

Version is the git commit hash.

Functions

func ExecTemplate

func ExecTemplate(tmpl string, data interface{}) (string, error)

ExecTemplate executes a template string into a string.

func IsOodlesError

func IsOodlesError(err error) bool

IsOodlesError returns true if the given error is an OodlesError (user error)

Types

type BotConfig

type BotConfig struct {
	Token    string `toml:"token"`
	Database string `toml:"database"`

	// Immutable owners, have access to all commands regardless of overrides (except disabled commands)
	Owners  []discord.UserID `toml:"owners"`
	GuildID discord.GuildID  `toml:"guild_id"`
	// Where errors and DMs are sent
	LogChannel discord.ChannelID `toml:"log_channel"`

	Help struct {
		Title       string       `toml:"title"`
		Description string       `toml:"description"`
		Fields      []EmbedField `toml:"fields"`
	} `toml:"help"`
}

BotConfig is the bot's configuration file. This contains authentication as well as data that is too complicated to store in a key-value format.

type EmbedField

type EmbedField struct {
	Name  string `toml:"name"`
	Value string `toml:"value"`
}

EmbedField ...

type OodlesError

type OodlesError string

OodlesError is an error that should be shown to the user directly

func Error

func Error(tmpl string, args ...interface{}) OodlesError

Error returns an OodlesError

func (OodlesError) Error

func (e OodlesError) Error() string

Directories

Path Synopsis
Package parameters provides an argument parser for dealing with a mix of quoted and unquoted arguments.
Package parameters provides an argument parser for dealing with a mix of quoted and unquoted arguments.

Jump to

Keyboard shortcuts

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