plugins

package
v0.0.0-...-5bff2fc Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCannotDisable        = errors.New("cannot disable plugins")
	ErrCannotEnable         = errors.New("cannot enable plugins")
	ErrCannotProcessMessage = errors.New("cannot process message")
	CannotDisable           = func() error {
		return ErrCannotDisable
	}
	CannotEnable = func() error {
		return ErrCannotEnable
	}
)

Functions

This section is empty.

Types

type Base

type Base struct {
	BaseName        string
	BaseDescription string
	// contains filtered or unexported fields
}

func (*Base) Description

func (b *Base) Description() string

func (*Base) Disable

func (b *Base) Disable() error

func (*Base) Enable

func (b *Base) Enable() error

func (*Base) Enabled

func (b *Base) Enabled() bool

func (*Base) Name

func (b *Base) Name() string

func (*Base) ProcessMessage

func (b *Base) ProcessMessage(s *discordgo.Session, m *discordgo.Message) error

func (*Base) ProcessReactionAdd

func (b *Base) ProcessReactionAdd(s *discordgo.Session, r *discordgo.MessageReactionAdd) error

func (*Base) ProcessReactionRemove

func (b *Base) ProcessReactionRemove(s *discordgo.Session, r *discordgo.MessageReactionRemove) error

func (*Base) RefreshStores

func (b *Base) RefreshStores(c *firestore.DocumentRef)

func (*Base) SyncStores

func (b *Base) SyncStores(c *firestore.DocumentRef)

type Plugin

type Plugin interface {
	Name() string
	Description() string
	Enable() error
	Disable() error
	Enabled() bool
	ProcessMessage(s *discordgo.Session, m *discordgo.Message) error
	ProcessReactionAdd(s *discordgo.Session, r *discordgo.MessageReactionAdd) error
	ProcessReactionRemove(s *discordgo.Session, r *discordgo.MessageReactionRemove) error
	SyncStores(c *firestore.DocumentRef)
	RefreshStores(c *firestore.DocumentRef)
}

Jump to

Keyboard shortcuts

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