38 lines
780 B
Go
38 lines
780 B
Go
package helperbot
|
|
|
|
import (
|
|
"time"
|
|
|
|
"git.bullercodeworks.com/brian/helperbot/models"
|
|
"github.com/slack-go/slack"
|
|
)
|
|
|
|
type Model interface {
|
|
SendMessage(msg models.BotMessage)
|
|
GetSlackAdminDMId() string
|
|
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
|
|
GetInt(path []string) (int, error)
|
|
SetInt(path []string, val int) error
|
|
}
|
|
|
|
type Message interface {
|
|
GetSource() string
|
|
GetDestination() string
|
|
GetType() string
|
|
GetTarget() string
|
|
GetText() string
|
|
}
|
|
|
|
type PluginState interface {
|
|
Name() string
|
|
Initialize(Model) error
|
|
ProcessMessage(models.BotMessage) bool
|
|
ProcessRTMEvent(*slack.RTMEvent) bool
|
|
Run()
|
|
Exit()
|
|
}
|