bot

package
v0.0.0-...-601e60f Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot interface {
	// Bots should return an EventType of what
	// they are able and willing to process.
	GetInterest() EventType
	// Gets called when a matching activity type is received.
	Execute(Webhook)
}

type BotFactory

type BotFactory interface {
	NewBot(SharedConfig, interface{}) Bot
}

type EventType

type EventType uint8

Used with "Interests"

const (
	AllEvents EventType = 255

	TaskEvent      EventType = 8
	GroupChatEvent EventType = 4
	UserEvent      EventType = 2
	QuestEvent     EventType = 1
	NoEvents       EventType = 0
)

func BuildInterest

func BuildInterest(es ...EventType) EventType

Pass in all EventTypes that a bot is interested in to create an aggregate EventType.

type SharedConfig

type SharedConfig struct {
	AccountUsername string
	Api             *HabiticaAPI
	Db              *sql.DB `mapstructure:"Db"`
}

Jump to

Keyboard shortcuts

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