Documentation ¶
Index ¶
- Constants
- Variables
- func CmdCompareChanged(opt1, opt2 *discordgo.ApplicationCommand) bool
- func EndPGX()
- func InitializeBot(configFile string, commandsDir string)
- func MapUpdateCompare(newMap, oldMap map[string]*discordgo.ApplicationCommand) map[string]uint8
- func OptionsComparedChanged(opt1, opt2 *discordgo.ApplicationCommandOption) bool
- func RegisterHandlers(handlers map[string]func(ctx *BotContext))
- func ResourceLoadFile(filePath string) string
- func ResourceLoadSQL(filePath string) string
- func RunQuery(file string, args ...interface{}) [][]interface{}
- type AuthUserData
- type AuthUsersList
- type BotContext
- type Command
- type CommandHandler
- type CommandOption
- type Config
- type DatabaseConfig
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
View Source
var Pool *pgxpool.Pool
Functions ¶
func CmdCompareChanged ¶
func CmdCompareChanged(opt1, opt2 *discordgo.ApplicationCommand) bool
func InitializeBot ¶
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 ResourceLoadSQL ¶
Types ¶
type AuthUserData ¶
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 ¶
Click to show internal directories.
Click to hide internal directories.