wc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Equal uint8 = iota
	Added
	Removed
	Updated
)

Variables

View Source
var (
	AuthUsers map[string]string
	CmdsList  []*discordgo.ApplicationCommand
)
View Source
var CommandHandlers = make(map[string]func(ctx *BotContext))
View Source
var DbConn string

Functions

func CmdCompareChanged

func CmdCompareChanged(opt1, opt2 *discordgo.ApplicationCommand) bool

func EndPGX

func EndPGX()

func InitializeBot

func InitializeBot(configFile string, commandsDir string)

example dirPath "./resources/commmands" example "config.toml"

func MapUpdateCompare

func MapUpdateCompare(newMap, oldMap map[string]*discordgo.ApplicationCommand) map[string]uint8

Compare each element of two maps, return an array of differences

func OptionsComparedChanged

func OptionsComparedChanged(opt1, opt2 *discordgo.ApplicationCommandOption) bool

func RegisterHandlers

func RegisterHandlers(handlers map[string]func(ctx *BotContext))

func ResourceLoadFile

func ResourceLoadFile(filePath string) string

func ResourceLoadSQL

func ResourceLoadSQL(filePath string) string

func RunQuery

func RunQuery(file string, args ...interface{}) [][]interface{}

variable input with variable output

Types

type AuthUserData

type AuthUserData struct {
	ID   string `toml:"id"`
	Name string `toml:"name"`
}

type AuthUsersList

type AuthUsersList struct {
	Entities []AuthUserData `toml:"Whitelist"`
}

type BotContext

type BotContext struct {
	Session     *discordgo.Session
	Interaction *discordgo.InteractionCreate
}

func (*BotContext) DgoDeferMsg

func (ctx *BotContext) DgoDeferMsg()

func (*BotContext) DgoEmbedMsg

func (ctx *BotContext) DgoEmbedMsg(title, value, footer string, options ...bool)

type Command

type Command struct {
	Name        string          `toml:"name"`
	Description string          `toml:"description"`
	Options     []CommandOption `toml:"options"`
}

type CommandHandler

type CommandHandler func(s *discordgo.Session, i *discordgo.InteractionCreate)

type CommandOption

type CommandOption struct {
	Name         string          `toml:"name"`
	Description  string          `toml:"description"`
	Type         int             `toml:"type"`
	Required     bool            `toml:"required"`
	Autocomplete bool            `toml:"autocomplete"`
	Options      []CommandOption `toml:"options"`
}

type Config

type Config struct {
	BotName  string
	KeyLoc   string
	ServerID string
	Database DatabaseConfig
}

type DatabaseConfig

type DatabaseConfig struct {
	Host     string
	Port     int
	User     string
	Password string
	DBName   string
}

Jump to

Keyboard shortcuts

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