helperbot/interfaces.go

33 lines
632 B
Go
Raw Normal View History

2019-11-13 00:45:56 +00:00
package helperbot
2019-11-22 18:37:15 +00:00
import (
"time"
"github.com/nlopes/slack"
)
2019-11-13 00:45:56 +00:00
type Model interface {
SendMessage(src, dest string, message slack.Message)
GetSlackAdminDMId() (string, error)
2019-11-22 18:37:15 +00:00
GetSlackLatency() time.Duration
2019-11-13 00:45:56 +00:00
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)
2019-11-22 18:37:15 +00:00
ProcessRTMEvent(slack.RTMEvent)
2019-11-13 00:45:56 +00:00
Run()
Exit()
}