bot

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package bot handles starting up and running the bot.

Index

Constants

This section is empty.

Variables

View Source
var ErrBotNotDefined = errors.New("bot not defined")

ErrBotNotDefined is returned if the bot definition cannot be found in the DB.

Functions

func Run

func Run(settings config.Settings)

Run the bot. nolint: funlen

Types

type Instance added in v0.1.0

type Instance struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Control string `json:"control"`
	// contains filtered or unexported fields
}

Instance of the bot.

func New added in v0.1.0

func New(id string, connection *db.Connection) (*Instance, error)

New bot instance.

func (*Instance) Handler added in v0.1.0

func (i *Instance) Handler(_ *discordgo.Session, in *discordgo.Message)

Handler will listen for a startup message from another bot and shut down if it sees one.

func (*Instance) Refresh added in v0.1.0

func (i *Instance) Refresh() error

Refresh the instance details from the database.

func (*Instance) Start added in v0.1.0

func (i *Instance) Start(session *discordgo.Session)

Start the bot. This will attempt to shut down any other bots registered with the same ID and Name.

Jump to

Keyboard shortcuts

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