helperbot/interfaces.go

33 lines
632 B
Go

package helperbot
import (
"time"
"github.com/nlopes/slack"
)
type Model interface {
SendMessage(src, dest string, message slack.Message)
GetSlackAdminDMId() (string, error)
GetSlackLatency() time.Duration
GetBytes(path []string) ([]byte, error)
SetBytes(path []string, val []byte) error
GetString(path []string) (string, error)
SetString(path []string, val string) error
}
type Message interface {
GetSource() string
GetDestination() string
GetMessage() slack.Message
}
type PluginState interface {
Name() string
Initialize(Model) error
ProcessMessage(Message)
ProcessRTMEvent(slack.RTMEvent)
Run()
Exit()
}