bot

package
v0.0.0-...-ff230d5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AdminTable = r.DB("config").TableCreate(
	"admin",
	r.TableCreateOpts{
		PrimaryKey: "userid",
	},
)
View Source
var ConfigDB = r.DBCreate("config")
View Source
var Log = minori.GetLogger("bot")
View Source
var PrefixFail = errors.New("failed to get a prefix")
View Source
var PrefixTable = r.DB("config").TableCreate(
	"prefix",
	r.TableCreateOpts{
		PrimaryKey: "guild",
	},
)
View Source
var TokenFail = errors.New("failed to get a token")
View Source
var TokenTable = r.DB("config").TableCreate("token")

Functions

This section is empty.

Types

type Admin

type Admin struct {
	UserID string
}

type Bot

type Bot struct {
	Startup time.Time
	Session *dg.Session
	DB      *db.DB
	Routes  []*route.Route
	Sig     chan os.Signal
}

func MkBot

func MkBot(dburl string) (*Bot, error)

func (*Bot) AddRoute

func (b *Bot) AddRoute(rs ...*route.Route)

func (*Bot) Admins

func (b *Bot) Admins() ([]string, error)

func (*Bot) Prefix

func (b *Bot) Prefix(guild, cont string) (string, string, error)

func (*Bot) Register

func (b *Bot) Register(dir, name string) error

func (*Bot) RegisterAll

func (b *Bot) RegisterAll(dir string) error

func (*Bot) Route

func (b *Bot) Route(s *dg.Session, m *dg.MessageCreate)

func (*Bot) Start

func (b *Bot) Start() error

func (*Bot) Token

func (b *Bot) Token() (*Token, error)

func (*Bot) Uptime

func (b *Bot) Uptime() time.Duration

func (*Bot) WaitReady

func (b *Bot) WaitReady()

type Prefix

type Prefix struct {
	Guild string
	Value string
}

type Token

type Token struct {
	Value string
}

Jump to

Keyboard shortcuts

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