internal

package
v0.0.0-...-3cc3726 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(config Config, bot Bot)

Types

type AuthServer

type AuthServer struct {
	Features map[string]*pkg.Feature // Registered features
	// contains filtered or unexported fields
}

AuthServer structure.

func (*AuthServer) Auth

func (a *AuthServer) Auth(args *pkg.AuthArgs, reply *pkg.AuthResponse) error

Auth function authentication framework.

func (*AuthServer) Register

func (a *AuthServer) Register(args *pkg.Feature, res *pkg.RegisterResponse) error

type Bot

type Bot struct {
	Client *dg.Session

	Features map[string]*pkg.Feature
	// contains filtered or unexported fields
}

func StartBot

func StartBot(config Config, path string) Bot

func (*Bot) OnMessage

func (bot *Bot) OnMessage(_ *dg.Session, msg *dg.MessageCreate)

func (*Bot) OnReady

func (bot *Bot) OnReady(_ *dg.Session, ready *dg.Ready)

type Config

type Config struct {
	Token  string   `yaml:"token"`
	Prefix string   `yaml:"prefix"`
	Roles  []string `yaml:"roles"`
	Port   int      `yaml:"port"`
	Guild  string   `yaml:"guild"`
}

Config structure.

func GetConfig

func GetConfig(path string) (config Config)

GetConfig retrieves config as Config from path.

Jump to

Keyboard shortcuts

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